日期:2014-05-17  浏览次数:20582 次

我想用BULK INSERT 导入十几万条的文本记录谁可以指教一下
我想用BULK INSERT 导入十几万条的文本记录
表结构为

CREATE TABLE [dbo].[pySY](
[ARSN] [char](5) NOT NULL,
[PID] [char](8) NOT NULL,
[TIM] [char](14) NULL,
[DCDS] [char](1) NULL,
[SPT] [char](8) NULL,
[SRT] [char](8) NULL,
[TPC] [char](10) NULL,
[TRC] [char](10) NULL,
[LSN] [char](8) NOT NULL,
[DS] [char](128) NULL,
[SendTag] [int] NOT NULL,
 CONSTRAINT [PK_pySY] PRIMARY KEY CLUSTERED 
(
[SendTag] ASC,
[PID] ASC,
[ARSN] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

表有十二列,最后一列是不能空值

文本文件为
2664 00011262 20130730223737 1 00000446 00000000 0000540.60 0000000.00 00319381 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02469 00011263 20130730230143 1 00000264 00000000 0000216.40 0000000.00 00219718 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02238 00011264 20130730173434 1 00000116 00000000 0000055.60 0000000.00 00239090 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02399 00011266 20130730224334 1 00000401 00000000 0000431.20 0000000.00 00280724 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02173 00011268 20130730221938 1 00000413 00000000 0000408.00 0000000.00 00318767 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02539 00011269 20130730185833 1 00000174 00000000 0000171.20 0000000.00 00282942 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02552 00011270 20130730231658 1 00000446 00000000 0000434.20 0000000.00 00280309 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
02624 00011272 20130730223617 1 00000084 00000000 0000074.20 0000000.00 00150609 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

文本只有十一列
请问用BULK INSERT 语句应该怎样导入表中