Applied to SQL Server 2005 or later.
CREATE TABLE dbo.tblTest(a int, b int)
INSERT INTO dbo.tblTest(a,b)
SELECT 1,2
UNION SELECT 3,4
UNION SELECT 4,5
DELETE dbo.tblTest OUTPUT DELETED.*
WHERE a > 1
Tuesday, December 8, 2009
Delete and return deleted rows
at 11:30 PM
Labels: SQL Server 2005, SQL Server Tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment