insert from file using only a stored procedure

  • Guys, is it possible to load a table from a txt file using only a stored procedure?

  • Not to worry. I found this

     

     

     

    BULK

    INSERT dbo.[DIM_ACCOUNT_MASTER_UTS_STG]

    FROM 'E:\FTP\test.txt'

    WITH (

    ROWTERMINATOR

    = '\n',

    FIELDTERMINATOR

    = '|',

    BatchSize

    = 10000,

    MAXERRORS

    = 0,

    FIRSTROW

    = 1

    )

  • Also, you can create a linked server using the Jet OLE DB provider.

    And new to SQL 2005, the OPENROWSET function with BULK option is very cool.

Viewing 3 posts - 1 through 2 (of 2 total)

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