Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Regarding BULK INSERT

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-01-20 : 17:35:11
Gopalakrishnan writes "1.How to use the NetWork Files for BULK INSERT Operation, With Example CodesPls?

2. In my Data File More than 30000 Lines are there, in that the First Line length is 100, and Rest of all Lines Length is 500
While Importing the Data, I want to Skip the First Line, When I use FIRSTROW=2, I am getting error "Server: Msg 4866, Level 17, State 66, Line 1
Could not bulk insert because column too long in data file. Make sure FieldTerminator and RowTerminator were specified correctly."
Pls help me in this Issue Immd.?"

DavidD
Yak Posting Veteran

73 Posts

Posted - 2002-01-20 : 19:51:20
The problem is probably in your creation of the text file. What do you put for your FieldTerminator and RowTerminator? The defaults for the Bulk Insert are a tab (field) and a new line (row).
If I am creating a text file from within SQL Servers export facility for use with the bulk insert I usually specify {CR LF} as the RowTerminator and Vertical bar as the field seperator (|). I then bulk insert using the following syntax.

BULK INSERT Database.dbo.tblName
FROM 'a:\tmpTable.txt'
WITH
(fieldterminator = '|')




Go to Top of Page
   

- Advertisement -