Desperate about the use of ' and " within an SQL statement!

  • Use EXECUTE sp_executesql @SQL

    Instead of sp_executesql @sql

  • Hi there, please move the semicolon at the end of the statement at the penultimate place.

    Like this

    SELECT @SQL = N'exec master..xp_cmdShell ''bcp DBA.dbo.x in \\RemoteServer\e$\DIR\Filename.csv -F02 /Sservname\Instancename -T /c /t'';'

    Tell us back if that solved teh issue!

  • EXEC sp_executesql did it...

    (burries his head in both hands and starts to cry)

    Tnx for answering both.

    Greetz,
    Hans Brouwer

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

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