Mssql vfp operations

Source: Internet
Author: User

Use a Transact-SQL statement in mssql2000 to process DBF Data Conversion
  
1. query DBF data
Select * From OpenDataSource ('vfpoledb', 'Data source = "D:/VFP/test. DBC" ')... test1
  
Select .*
From OpenRowSet ('msdasql ',
'Driver = {Microsoft Visual FoxPro driver };
Exclusive = no; collate = machine; deleted = yes; null = no;
Sourcedb = D:/VFP/test. dBc; sourcetype = dBc ;',
'Select * From test1') as
  
Select *
From OpenRowSet ('msdasql ', 'driver = Microsoft Visual FoxPro driver;
Sourcedb = D:/VFP/; sourcetype = dbf ',
'Select * From test3 ')
  
2. Import DBF data to MSSQL
Select * into test1 from OpenDataSource ('vfpoledb', 'Data source = "D:/VFP/test. DBC" ')... test1
  
3. Import SQL data into DBF
Insert into OpenRowSet ('msdasql ', 'driver = {Microsoft Visual FoxPro driver}; exclusive = no; collate = machine; deleted = yes; null = no; sourcedb = D: /VFP/test. dBc; sourcetype = dBc; ', 'select * From test1') Select * From test1
  
4. modify data
Update OpenRowSet ('msdasql ', 'driver = Microsoft Visual FoxPro driver; sourcedb = D:/VFP/; sourcetype = dbf ', 'select * From test3 where code = "11" ') Set Name =' "12 "'

 

The following are my methods for successful testing:

Select .*
From OpenRowSet ('msdasql ', 'driver = {Microsoft Visual FoxPro driver };
Exclusive = no; collate = machine; deleted = yes; null = no;
Sourcedb = D:/work/vf/data1.dbc; sourcetype = dBc ;',
'Select * From nsnew1000200.dbf') as

Select * From OpenRowSet ('msdasql ',
'Driver = Microsoft Visual FoxPro driver; sourcetype = DBF; sourcedb = D:/work/vf /',
'Select * from [nsnew1000200.dbf] ')

Select *
From OpenRowSet ('msdasql ', 'driver = Microsoft Visual FoxPro driver;
Sourcedb = D:/work/vf/; sourcetype = dbf ',
'Select * From nsnew1000200.dbf ')

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.