5

This is my sql

BULK INSERT dbo.Account FROM 'G:\Import\Account3.txt'
WITH
(
    FIELDTERMINATOR = '" | "'
)
GO

When I run the sql i got this error

Msg 4866, Level 16, State 1, Line 1
The bulk load failed.

The column is too long in the data file for row 1, column 1. Verify that the field terminator and row terminator are specified correctly.

Msg 7399, Level 16, State 1, Line 1
The OLE DB provider "BULK" for linked server "(null)" reported an error. The provider did not give any information about the error.

Msg 7330, Level 16, State 2, Line 1
Cannot fetch a row from OLE DB provider "BULK" for linked server "(null)".

Please help me. I already tried many ways but still get the same error.

Community
  • 1
  • 1
riza
  • 51
  • 1
  • 1
  • 4

2 Answers2

4

From your example SQL, it seems you are missing a ROWTERMINATOR statement, specifying how rows are to be differentiated from one another.

Your query would then become something like

BULK INSERT dbo.Account FROM 'G:\Import\Account3.txt'
WITH
(
FIELDTERMINATOR = '" | "',
ROWTERMINATOR = '\r\n'
)
GO
Tom Lint
  • 483
  • 5
  • 13
-1

Try this

BULK
INSERT dbo.Account 
FROM 'G:\Import\Account3.txt'
WITH
(
FIELDTERMINATOR = '|',
ROWTERMINATOR = '\n'
)
GO
Prahalad Gaggar
  • 11,389
  • 16
  • 53
  • 71
  • When I run this script i got this error Msg 102, Level 15, State 1, Line 1 Incorrect syntax near 'GO'. I Hope somebody can help me. This is my first time do this – riza Jan 23 '13 at 10:05
  • I tried to user another script but still get the same error. This is my new script USE Reporting_DB_Test; GO BULK INSERT dbo.Account FROM 'G:\Import\Account.txt' WITH ( CHECK_CONSTRAINTS, FIELDTERMINATOR = '" | "', KEEPNULLS , CODEPAGE='RAW', KEEPIDENTITY ); GO Please I really need help. – riza Jan 25 '13 at 01:09