James123
James123

Reputation: 11652

Call update Stored procedure in SQL Linked server?

I have SQL server and It has another SQL server Linked server [DEV]. Now I want call a stored procedure in Linked server and get the result value. It is always giving error. I tried below both statements none of the did not worked.

     ALTER PROCEDURE [dbo].[UpdateMemebership_Lock_Count] 
                @v_constit_id_in  as  varchar(100) 
            AS
            BEGIN

                 Exec ('Call [Members_Directory_Search_DEV].[dbo].[update_dirsearch_notes]
(?)',@v_constit_id_in) AT [DEV]
                --Exec [DEV]..[Members_Directory_Search_DEV].[update_dirsearch_notes]
     @v_constit_id_in

            END

Error

Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.

Upvotes: 0

Views: 1454

Answers (1)

Stuart Ainsworth
Stuart Ainsworth

Reputation: 12940

Not sure what syntax you are used to using (CALL is used for Analysis Services, not SQL Server), but linked servers have a four part notation:

ServerName.DatabaseName.owner.object

Try:

Exec [DEV].[Members_Directory_Search_DEV].dbo.[update_dirsearch_notes]      @v_constit_id_in 

Upvotes: 1

Related Questions