• So the simplest would be to defined a linked server, then you would not need to use dynamic SQL, but you could make a plain procedure call.

    But to continue on the track where you are right now, you could use sp_executesql instead. See my article on dynamic SQL for details:

    http://www.sommarskog.se/dynamic_sql.html

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]