日期:2014-05-17 浏览次数:20672 次
BULK INSERT #TMP1 FROM 'D:\盘点单\BM20120815SBK.txt' WITH ( FIELDTERMINATOR =',', ROWTERMINATOR ='\n', KILOBYTES_PER_BATCH=5000 )
DECLARE @fileName NVARCHAR(50) SET @fileName='D:\盘点单\BM20120815SBK.txt' BULK INSERT #TMP1 FROM 'D:\盘点单\BM20120815SBK.txt' WITH ( FIELDTERMINATOR =',', ROWTERMINATOR ='\n', KILOBYTES_PER_BATCH=5000 )
--这种只能用动态sql DECLARE @fileName NVARCHAR(50),@sql nvarchar(1000) SET @fileName='D:\盘点单\BM20120815SBK.txt' select @sql='BULK INSERT #TMP1 FROM '''+@fileName+''' WITH ( FIELDTERMINATOR ='','', ROWTERMINATOR =''\n'', KILOBYTES_PER_BATCH=5000 )' exec(@sql)