Friday, March 23, 2012

Running Stored Procedures on Linked servers from Microsoft SQL server

Hi,
I am trying to invoke storedprocedures on a linked server from MS SQL SERVER and it fails to recognise the object as a SP rather it gives me a message saying that the object does not have any columns. The Linked server is a SYBASE server. I can access all the tables and views but not the procedures. By the way, I have set the following server options on for the linked sybase server --
RPC OUT
RPC
But the Use Remote Collations is not turned on.

Please help!!!!!!!!!!!!!!!

Regards

JCI ran into something similar before when trying to execute SPs on a linked server (although they both were MS SQL Server)...

I remember having to use a fully qualified procedure name when I executed it:

EXEC LinkedServerName.DbName.DbOwner.SPName xxx,xxx,...

I dunno if this is applicable with your situation as I have never linked to another db platform other than from MS SQL Server to MS Access. I've use Sybase ASE before...but never in a linked scenario...

Kael|||I got your email stating that using a fully qualified name didn't work.

An idea I have is maybe examining the parameters that were used for the sp_addlinkedserver stored proc when the link was made from Sybase to MS SQL Server. Try dropping the linked server and recreating it.

Also, you can try using the OpenQuery function in the FROM clause on SQL Server rather than using a fully qualified name.

Are you using the OLE DB Provider for Sybase SQL Server (or named something like that) as the data provider when the linked server SP was used? Maybe try updating the DLL for that provider. I'd use OLE DB rather than a generic provider since it will expose more functionality.

Good luck!

Kael

No comments:

Post a Comment