Let's say that the IP address of my computer is 192.168.3.109.
In my Microsoft SQL Server Management Studio Express, I have 2 databases:
I have created the stored procedure below in the database called DB_ONE. It will retrieve all records from the table called "MY_TABLE" in the "DB_TWO" database. So far this works fine.
But now I have another computer with IP address of 192.168.3.110 and in its Microsoft SQL Server Management Studio Express there's a database called DB_THREE, and there's a table called HIS_TABLE.
How do I modify the stored procedure below (that's running on 192.168.3.109) to retrieve all records from "HIS_TABLE" in "DB_THREE" (which is running on 192.168.3.110)?
Is this even possible in the first place? Thanks.
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
CREATE PROCEDURE sp_test
SET NOCOUNT ON;
select * from DB_TWO.dbo.MY_TABLE