|
Posted by Craig Kelly on 10/01/52 11:28
<savvaschr@nodalsoft.com.cy> wrote:
> Hello
>
> I am trying to execute a BULK INSERT ... this is my code
> BULK INSERT myTableSQL.dbo.[Daily_ss] FROM 'c:\daily_ss.txt'
> WITH (
> DATAFILETYPE='native',
> FIELDTERMINATOR = 'char(9)',
> ROWTERMINATOR = '\n'
> )
>
> But I get an Error
>
> Server: Msg 4866, Level 17, State 66, Line 1
> Bulk Insert fails. Column is too long in the data file for row 1,
> column 1. Make sure the field terminator and row terminator are
> specified correctly.
> Server: Msg 7399, Level 16, State 1, Line 1
> OLE DB provider 'STREAM' reported an error. The provider did not give
> any information about the error.
> The statement has been terminated.
>
> 1. The FIELDTERMINATOR in my file is the tab ...is it correct that i
> declare it as char(9)???
>
> 2. the date format in the text file are dd/mm/yyyy will i have a
> problem with this? Because SQL uses mm/dd/yyyy
>
> 3. I used this with DATAFILETYPE='char' and i get the same error
>
> Please HELP :)
> Thanks
I believe the command you want is...
BULK INSERT myTableSQL.dbo.[Daily_ss] FROM 'c:\daily_ss.txt'
WITH (
DATAFILETYPE='char',
FIELDTERMINATOR = '\t',
ROWTERMINATOR = '\n'
)
Craig
Navigation:
[Reply to this message]
|