0

From SQL Server Management Studio I have connected to an SQL Server database engine. This database engine has a lot of databases. From a store procedure defined in a database I am trying to call a store procedure in another database that it is in another SQL Server database engine. So I have done:

exec [MyDatabaseEngine].[MyDatabase].[MyStoreProcedure] param1, param2

But it is not working.

I do not know if I have explained it correctly. If not, please let me know.

1
  • @SeanLange arrgggggg, yes... you are right! thx very much! Post the answer and I will vote you. Commented Jun 7, 2017 at 16:02

2 Answers 2

3

You are missing the schema. The format is [LinkServer].[Database].[Schema].[Object]

Sign up to request clarification or add additional context in comments.

Comments

2

You need to have linked server created with credentials access to the other database. More info

https://learn.microsoft.com/en-us/sql/relational-databases/linked-servers/create-linked-servers-sql-server-database-engine

Once you have it, you can run queries on another server

SELECT name FROM [SRVR002\ACCTG].master.sys.databases ;  
GO 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.