We have a database on a SQL Server 2014 instance. We have another on a 2008R2 instance. Both on the same server.
I have created a linked server on the 2008R2 instance to the 2014 one.
However, I am only able to see tables & views.
Is it possible to call stored procedures and functions in the 2014 instance using the linked server?
If not what is my best/simplest solution?
Best Answer
You can call procedures easily:
TVFs will be a different issue:
And no, you can't fool SQL Server by creating a synonym so that it doesn't detect a 4-part name; it will just return a different error, e.g.:
To work around this, you can either put the call to the TVF inside a remote procedure and call it like above, or do something like this:
If you need more direct interaction (e.g. cross applying the TVF against local tables), you might have to perform that on the remote server using a linked server in the other direction for the table data: