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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Trigger on delete

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-07-13 : 10:17:49
Meghana writes "I want to fire a trigger when I delete a record from first table of first database and the trigger should delete the same record from the another table from another database in SQL server.
If I wrote a trigger 'for delete', trigger executes when the record gets deleted and I am not able to get the primary key because the record is already deleted.
Can it is possible?"

Kristen
Test

22859 Posts

Posted - 2004-07-13 : 11:10:58
[code]
CREATE TRIGGER MyTrigger ON dbo.MyTable
AFTER DELETE
AS
DELETE X
FROM deleted D
JOIN OtherServer.dbo.OtherTable X
on X.PK = D.PK
[/code]

Kristen
Go to Top of Page
   

- Advertisement -