April 8, 2011 at 7:33 am
Hi,
Seems really trivial, but I can't make it works:
SET @NoDossier = '1315-21738'
SELECT *
INTO #MyTable
FROM OPENROWSET('SQLNCLI',
'Server=SQL2008;Database=xDManagement;Uid=user;Pwd=Passw;',
'EXEC xDRxVGetPil_sp ''''' + @NoDossier + '''''');
Error is: Incorrect syntax near '+'.
can someone help me on that matter please?
thanks for your time abd help
April 8, 2011 at 7:54 am
OPENROWSET - does NOT accept variables for its arguments.
Thus you will have to use dynamic sql statements to do what you seem to need to do.
Use this link:
http://technet.microsoft.com/en-us/library/ms190312(SQL.90).aspx
Scroll down to the "Remarks" section.
Edited to add link.
April 8, 2011 at 8:15 am
Is there any way I can call a storedProc with parameters on a linked server and put the resulting recordset on a local temporary table, like I need to do here?
April 8, 2011 at 8:52 am
Dominic Gagné (4/8/2011)
Is there any way I can call a storedProc with parameters on a linked server and put the resulting recordset on a local temporary table, like I need to do here?
Since your original post was about a specific T-SQL snippet of code, may I suggest you post what is basically a new question to a new forum so as to obtain the proper assistance.
April 8, 2011 at 9:48 am
ok, thank you very much for your assistance
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply