CREATE TRIGGER sampleTrigger
ON database1.dbo.table1
FOR DELETE
AS
DELETE FROM database2.dbo.table2
WHERE bar = 4 AND ID IN(SELECT deleted.id FROM deleted)
GO
More Related Contents:
- Creating audit triggers in SQL Server
- Insert multiple rows WITHOUT repeating the “INSERT INTO …” part of the statement?
- Does T-SQL have an aggregate function to concatenate strings? [duplicate]
- Parameter Sniffing (or Spoofing) in SQL Server
- What are the main performance differences between varchar and nvarchar SQL Server data types?
- SQL Server String or binary data would be truncated
- Datatype for storing ip address in SQL Server
- How to change identity column values programmatically?
- best way to convert and validate a date string
- Why use the INCLUDE clause when creating an index?
- CAST and IsNumeric
- SQL Server pivot vs. multiple join
- How do you specify a different port number in SQL Management Studio?
- SQL Server GUID sort algorithm. Why?
- SQL Server history table – populate through SP or Trigger?
- Aggregate bitwise-OR in a subquery
- Check if a temporary table exists and delete if it exists before creating a temporary table
- Parse XML in SQL Server
- Drop primary key using script in SQL Server database [duplicate]
- How to create the linked server for SQL Server 2008 where we have the database from 2000 and 2005
- Check if a string contains a substring in SQL Server 2005, using a stored procedure
- FOR XML PATH(”): Escaping “special” characters
- How to store directory / hierarchy / tree structure in the database?
- INFORMATION_SCHEMA vs sysobjects
- Does query plan optimizer works well with joined/filtered table-valued functions?
- “Prevent saving changes that require the table to be re-created” negative effects
- Get row where datetime column = today
- Convert UTC Milliseconds to DATETIME in SQL server
- Full text catalog/index search for %book%
- @@ERROR and/or TRY – CATCH