将这个text文件,批量插入数据库:
262064 ¦262064 ¦0 ¦私户 ¦黄增广¦枣子山40栋二箱上六只 ¦双月 ¦生活
262063 ¦262063 ¦0 ¦私户 ¦金弢 ¦艺(冶钢)49栋西头3单元左5箱上5 ¦双月 ¦生活
create table #T(col1 int,col2 int,col3 int,col4 nvarchar(10),
col5 nvarchar(10),col6 nvarchar(20),col7 nvarchar(10),col8 nvarchar(10))
bulk insert #T from 'D:\tt.txt'
with
(
datafiletype='widechar',
fieldterminator='¦'
)
select * from #T
col5 nvarchar(10),col6 nvarchar(20),col7 nvarchar(10),col8 nvarchar(10))
bulk insert #T from 'D:\tt.txt'
with
(
datafiletype='widechar',
fieldterminator='¦'
)
select * from #T