简体   繁体   中英

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 '.'.

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM