SQL 2008

  • Can someone help me please with this request:

    SET @SQL = 'SELECT *,''A'' FROM OPENQUERY(' + @VALEUR_PARAM+''',SELECT * FROM DAGCONS)'''

    i got this error mess:

    Msg 105, Level 15, State 1, Line 1

    Unclosed quotation mark after the character string ',SELECT * FROM DAGCONS'.

    Msg 102, Level 15, State 1, Line 1

    Incorrect syntax near ',SELECT * FROM DAGCONS'.

  • Move quotation sign behing comma.

  • i don't really understand your reply

  • Try printing your @SQL variable to know how the string is formed and identify syntax errors more easily.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

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

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