Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 linked server usage

Author  Topic 

bobz_0585
Yak Posting Veteran

55 Posts

Posted - 2009-03-09 : 11:25:11
hey all
guys i created a linked server connection to a remote server ...the reason why i did this is that i want to create a shadow linked table...they are linked through primary key and every record added there the primary key of it should be added to my table...how should i do that?? how can i link my table to the key of the remote table please help

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2009-03-09 : 11:55:38
Use Transactional Replication.
Go to Top of Page

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-03-09 : 12:05:24
Different methods:
1.(READ)
Don't actually import any data - just set up a view which reads the primary key field e.g.
Create View vw_lnkPKs
AS
Select PKfield from [linkName].dbo.[table]
GO

2.(PULL)
Set up an SSIS job to periodically read the linked table and insert new rows to "shadow table"

3.(PUSH)
Have an INSERT trigger on table on the remote server which inserts a new record in your "shadow table" To do this you should set your "shadow server" as a linked server on the remote server.

I'm sure others have other methods but my preference would be the view - no need to maintain data integrity in the "shadow".
Go to Top of Page
   

- Advertisement -