导出到TXT文本,用逗号分开 exec master..xp_cmdshell ’bcp "库名..表名" out "d:\tt.txt" -c -t ,-U sa -P password’
BULK INSERT 库名..表名 FROM ’c:\test.txt’ WITH ( FIELDTERMINATOR = ’.’, ROWTERMINATOR = ’\n’ )
--/* dBase IV文件 0select * from OPENROWSET(’MICROSOFT.JET.OLEDB.4.0’ ,’dBase IV.HDR=NO.IMEX=2.DATABASE=C:\’,’0select * from [客户资料4.dbf]’) --*/
--/* dBase III文件 0select * from OPENROWSET(’MICROSOFT.JET.OLEDB.4.0’ ,’dBase III.HDR=NO.IMEX=2.DATABASE=C:\’,’0select * from [客户资料3.dbf]’) --*/
--/* FoxPro 数据库 0select * from openrowset(’MSDASQL’, ’Driver=Microsoft Visual FoxPro Driver.SourceType=DBF.SourceDB=c:\’, ’0select * from [aa.DBF]’) --*/
/**************导入DBF文件****************/ 0select * from openrowset(’MSDASQL’, ’Driver=Microsoft Visual FoxPro Driver. SourceDB=e:\VFP98\data. SourceType=DBF’, ’0select * from customer where country != "USA" order by country’) go