I need to create a trigger on Server A to delete two tables on Server B. Tables are same name and replicated.
The trigger would run after replication successful on Server A.
Pls. advise on syntax for accessing Server B table from Server A.
You have to setup a linked server on ServerA pointing to ServerB. You can then access the objects which you have rights to using the objects four part name.
Code:
delete from ServerB.Database.dbo.TableName
Where PrimaryKey = 'SomeValue'
Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)
--Anything is possible. All it takes is a little research. (Me)
I finally did get it-forgot about 4-part notation-already had linked server.
found another interesting issue-could not run distributed queries after above completed due to MSDTC error.
Found solution on this link to correct MSDTC issue:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.