Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    9

    Unhappy Unanswered: Bulk Copy Terror

    Hi there,

    I'm in dire need for a solution to a "Bulk Insert" problem.

    Environmental: SQL 7
    The unc path used is a shared folder on the local machine with full rights.

    This is the SQL Table:

    CREATE TABLE [dbo].[ArgiefTransaksies] (
    [TakDepotKodeRef] [char] (4) NULL ,
    [HoofraamNommer] [varchar] (2) NULL ,
    [Dokumentnommer] [decimal](2, 0) NULL ,
    [DataLyn] [varchar] (133) NULL)

    Here is the file that I try to upload, TESTFILE.PRN

    RZGB|FT|12| |\n
    RZGB|FT|12| |\n
    RZGB|FT|12| |\n
    RZGB|FT|12| |\n
    RZGB|FT|12|This is a test|\n
    RZGB|FT|12| |\n
    RZGB|FT|12|Zone 1 Zone 2|\n
    RZGB|FT|12|Hello World||\n
    RZGB|FT|12| 5 leading spaces|\n
    RZGB|FT|12| Tab(10) - Hello|\n


    Here is the SQL statement that I try to use:

    Exec sp_dboption 'VKBTakDev', 'select into/bulkcopy', 'TRUE'

    BULK INSERT ArgiefTransaksies
    FROM '\\HKDATA060XP\Public\TESTFILE.PRN'
    WITH
    (
    DATAFILETYPE = 'char',
    FIELDTERMINATOR = '|',
    ROWTERMINATOR = '|\n',
    MAXERRORS = 0,
    CODEPAGE = 'raw'
    )

    Here is the error that I keep getting...

    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.

    Regards

  2. #2
    Join Date
    Aug 2002
    Location
    Scotland
    Posts
    1,578

  3. #3
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Have you tried BCP? See what happens when you go through the BCP wizard and create a format file. If it succeeds try to use it in BULK INSERT.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •