problem with OPENROWSET(BULK...)

  • Hi,

    I want to reada textfile which will further on be used in a mail sent from the database.

    To read this file i want to use the OPENROWSET(BULK..) command. I've posted my sample code below:

    select * FROM OPENROWSET

    ( BULK 'C:\tjena.txt',SINGLE_CLOB)

    This code gives me the error "incorrect syntax near BULK". But I can't see whats wrong with the syntax in my code?

    Does anyone have a clue of what might be wrong?

    Thanks in advance,

    JF

  • johan.frisell (8/20/2008)


    Hi,

    I want to reada textfile which will further on be used in a mail sent from the database.

    To read this file i want to use the OPENROWSET(BULK..) command. I've posted my sample code below:

    select * FROM OPENROWSET

    ( BULK 'C:\tjena.txt',SINGLE_CLOB)

    This code gives me the error "incorrect syntax near BULK". But I can't see whats wrong with the syntax in my code?

    Does anyone have a clue of what might be wrong?

    Thanks in advance,

    JF

    OPENROWSET BULK has been introduced in SQL Server 2005. What version of SQL Server are you trying to do the above?

    Regards,

    Andras


    Andras Belokosztolszki, MCPD, PhD
    GoldenGate Software

  • Andras Belokosztolszki (8/20/2008)


    johan.frisell (8/20/2008)


    Hi,

    I want to reada textfile which will further on be used in a mail sent from the database.

    To read this file i want to use the OPENROWSET(BULK..) command. I've posted my sample code below:

    select * FROM OPENROWSET

    ( BULK 'C:\tjena.txt',SINGLE_CLOB)

    This code gives me the error "incorrect syntax near BULK". But I can't see whats wrong with the syntax in my code?

    Does anyone have a clue of what might be wrong?

    Thanks in advance,

    JF

    OPENROWSET BULK has been introduced in SQL Server 2005. What version of SQL Server are you trying to do the above?

    Regards,

    Andras

    There is no issue with the syntax just give correlation name to the query and it should work IF YOU ARE RUNNING ON SS2K5

    select * FROM OPENROWSET

    ( BULK 'C:\tjena.txt',SINGLE_CLOB) x

  • Ah ok thanks!

    Got confused since i use EM2005 but towards a SQL2000 DB, which makes the word BULK turn blue so I didn't even think about version problems 🙂

    Thanks for your help.

    /JF

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

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