txt文件导入Sql Server数据库表方法
代码
create table tablet(
A nvarchar(100),
b nvarchar(100),
C nvarchar(100)
)
Bulk insert Codematic..tablet from 'c:\dd.txt'
with(
datafiletype = 'char',
fieldterminator = '|',
rowterminator = '\n'
)
select * from tablet
A nvarchar(100),
b nvarchar(100),
C nvarchar(100)
)
Bulk insert Codematic..tablet from 'c:\dd.txt'
with(
datafiletype = 'char',
fieldterminator = '|',
rowterminator = '\n'
)
select * from tablet
BULK INSERT dbname..user FROM 'c:\123.txt'
WITH (
DATAFILETYPE = 'char',
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)