Hi.
I have a stored procedurein my database and I want to access table in otherserver. can I do that in Stored procedure?
kojoh:
I have a stored procedurein my database and I want to access table in otherserver. can I do that in Stored procedure?
as long as you SQL Server that has the stored procedured has the link server configured, it would work.
|||Thank's for replay , I will give you an example to explane what I want.
CREATE PROCEDURE [dbo].[MySP]ASinsert into memberselect *from member1
the table member in the current server and the table member1 in other server.
Regards.|||
As long as you have configured the link server to the member1 table then it would work as you need linked servers to run distributed queries.
Here are some articles on linked servers and distributed queries
http://msdn2.microsoft.com/en-us/library/aa213778(SQL.80).aspx
http://msdn2.microsoft.com/en-us/library/ms188279.aspx
http://www.databasejournal.com/features/mssql/article.php/3085211
|||Thank's alotjimmy
I try to implement the setpes but I can't get it .
CREATE PROCEDURE [dbo].[link]ASexecsp_addlinkedserver @.server ='Srv' , @.srvproduct ='' , @.provider='SQLOLEDB' ,@.datasrc ='Srv'select invcompfrom [Srv].[DB].glcomGO
when I run the script it give me
(1 row(s) affected)
(1 row(s) affected)
Server: Msg 208, Level 16, State 1, Procedure link, Line 4
Invalid object name 'Srv.DB.glcom'.
I use sql server 2000.
No comments:
Post a Comment