假如文本文件c:/a.txt内容是这样
id,name,val
1,aaaaaa,123
2,bbbbbb,234
导入语句就是
BULK INSERT 表1 FROM 'c:/a.txt'
WITH (FIRSTROW=2,FIELDTERMINATOR = ',',ROWTERMINATOR = '/n')
或者
insert into 表1 (id, name, val)
select id, name, val from OpenRowset(
'MSDASQL',
'Driver={Microsoft Text Driver (*.txt; *.csv)};DefaultDir=C:/;',
'select * from a.txt')