S3minaki
S3minaki

Reputation: 319

Connect an execute insert query to another database of another server

I am using SQL Server on a Windows Server.

The scenario is that i have the SQLInstance1 to the windows Server1 and the Instance2 to the Windows Server 2. The 2 Windows servers aren't in the same domain, but i know their IP.

I would like to know if i can run a stored procedure, from SQLInstance1, in order to insert some data to the SQLInstance2. Is it possible? If yes, can you tell me how?

Upvotes: 0

Views: 820

Answers (2)

ARAZI
ARAZI

Reputation: 126

yes it is possible to do this :

1 - even you use a Linked server and run the store precedure from instance1 to insert into instance2 , you have to create linked server and give acces ot the user that will run the SP on the other instance

here is how to use linked serveurs

click [here] (https://learn.microsoft.com/fr-fr/sql/relational-databases/linked-servers/linked-servers-database-engine?view=sql-server-2017)!

Upvotes: 1

Adinugraha Tawaqal
Adinugraha Tawaqal

Reputation: 371

You can set up Linked Server. Then you just need to call by their alias, almost the same like calling table from another database.

Upvotes: 1

Related Questions