INSERT INTO SQL Server : Linked Server without specifying database in semi-fully qualified name
-1
votes
2
answers
1081
views
I have a server called
DEV
, a database called Nus12345
, a linked server called SnapshotDev
, a schema called Snapshot
, and a table called SnapshotPersonEmployee
.
On the DEV server, there are many other databases. On the linked server, there are the same databases as on DEV.
Right now I have a stored procedure that inserts into the table with
INSERT INTO Snapshot.SnapshotPersonEmployee
We are instead conceptually wanting to change to inserting into a table on a linked server by using
INSERT INTO [SnapshotDev].[Nus12345].[Snapshot].[SnapshotPersonEmployee]
My question is, can I insert into the table on the linked server **without** changing the stored procedure? Is there a way (like making a synonym) that will reference the table on the linked server with just
INSERT INTO Snapshot.SnapshotPersonEmployee
**EDIT**
I should add that this stored procedure appears once on every database, and that is why I want to try to do this without change the stored procedure. By not naming the database it allows us to keep one version of the stored procedure--one SP on each database, but they are all the same.
We are thinking of removing the SnapshotPersonEmployee
table in the current (DEV) server from all of the databases. Would this help/hinder any possible solutions?
Asked by Jeff.Clark
(627 rep)
Jun 29, 2016, 08:47 PM
Last activity: Nov 17, 2019, 04:04 AM
Last activity: Nov 17, 2019, 04:04 AM