Msg 4862, Level 16, State 1, Line 1

  • with reference to OPENROWSET (TRANSACT-SQL) http://technet.microsoft.com/en-us/library/ms190312.aspx

    example E

    data

    1 Data Item 1

    2 Data Item 2

    3 Data Item 3

    no-xml format file

    9.0

    2

    1 SQLCHAR 0 0 "\t" 1 ID SQL_Latin1_General_Cp437_BIN

    2 SQLCHAR 0 0 "\r" 2 Description SQL_Latin1_General_Cp437_BIN

    when I execute the above the code, I get the following errors:

    Msg 4862, Level 16, State 1, Line 1

    Cannot bulk load because the file "E:\certification\sql_server\sql_server_2012\mcsa\70-461\practise\openrowset\values.fmt" is incomplete or could not be read. Operating system error code (null).

    May I know how to resolve the issue?

    with reference to previous previous forum post http://www.sqlservercentral.com/Forums/Topic445398-9-1.aspx

    I have appended a return on the last line. Still I could not resolve the error.

    thanks a lot!

  • http://stackoverflow.com/questions/8229989/bulk-insert-w-fmt-file-operating-system-error-code-null

    States that the .fmt file needs a blank line at the end.

    Though when I try it i get even more errors.

    Msg 4832, Level 16, State 1, Line 1

    Bulk load: An unexpected end of file was encountered in the data file.

    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)".



    For better, quicker answers on T-SQL questions, read Jeff Moden's suggestions.[/url]

    "Million-to-one chances crop up nine times out of ten." ― Terry Pratchett, Mort

  • I have placed a carriage returned at the end of both file text1.txt file and values.fmt

    and I encounter the following err

    Msg 4832, Level 16, State 1, Line 1

    Bulk load: An unexpected end of file was encountered in the data file.

    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)".

    Just don't understand despite the addition of carriage return in both text1.txt file and values.fmt, the problem is still not resolved.

  • Try this one:

    9.0

    2

    1 SQLCHAR 0 10 "\t" 1 ID SQL_Latin1_General_Cp437_BIN

    2 SQLCHAR 0 40 "\r" 2 Description SQL_Latin1_General_Cp437_BIN

    Worked like a charm for me 😉

  • Can you attach your data files and your format files?

    There is a bug in the SQL Server Central software, so that backslash-n is dropped from the posts, which has serious implications for format files and bulk-load operations.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply