i have this query and what i want to do is to execute a stored procedure from another server to get results.
i need to pass a paramenter in the sp.
my problem is that is not working and i don´t know what i have to do put this to work.
hope that someone can help me out with this.
this is my code:
DECLARE @EXECSQL3 VARCHAR(500), @a VARCHAR(300), @b INT
SET @a = 'test'
Set @b = 100
SET @EXECSQL3 = 'SELECT * FROM OPENROWSET
(''xxxxx'',''xxxxxx'';''xxxxxxx'';''xxxxxxx'',
''[DB].[dbo].[MyStoredProcedure] @a, @b'')'
EXEC(@EXECSQL3)