linked server

  • Hi All,

    I am tring to run a query using linked server.I have a sp in a server and I am trying to exec that sp from one server and the results should update the table in the server from where i am linking server.

    Is there any way to execute the sp and bring back the results in the table.

    Thanks

  • Hi All,

    I have 2 servers.

    1) sqlbackup

    2) metrosql

    Both have same database and all the tabels and sp are same on both side.

    I want to make a linke server which I have already done,Now I want to exec one sp after

    making linked servers and the sp should returned the results into a table (opsstats).Is there any way to exec sp and get the results from the server and update the table (opsstats).I tried many commands but all are givind me errro or results from the same server but not from linked server.

    Please guid me what to do.

    Thanks.

  • Hi Zia

    You can try this

    SELECT * FROM OPENQUERY(linkedserver, 'Exec pubs.dbo.SP_Get_rows')Table1

    Here U r getting a Table instance(Table1)..This instance you can use for updating your real table.

    Hope this will help you.

    Regards

    Agson C A

  • Hi,

    I tried

    SELECT * FROM OPENQUERY(metrosql, 'Exec metrofiledb.dbo.SP_opsstats')opsstats

    but it came the below error msg

    Could not process object 'Exec metrofiledb.dbo.SP_opsstats'. The OLE DB provider 'SQLOLEDB' indicates that the object has no columns.

    But I already solved the query by changing

    in my sp calling linked server and updating

    table opsstats and bringing back the the specific column which i want to show my accounts dept.

    Tanks for reply

    Keep on smiling

    Bye

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply