TRIGGER ALTERNATIVE FOR DELETE
CREATE TABLE #testing
([Name] VARCHAR(50))
INSERT #testing
VALUES('Raemsh')
INSERT #testing
VALUES('Sateesh')
INSERT #testing
VALUES('Madhu')
GO
CREATE TABLE #HoldDeleteData
([Name] VARCHAR(50))
DELETE FROM #testing
OUTPUT DELETED.* INTO #HoldDeleteData
WHERE [Name]='Madhu'
SELECT *FROM #HoldDeleteData
([Name] VARCHAR(50))
INSERT #testing
VALUES('Raemsh')
INSERT #testing
VALUES('Sateesh')
INSERT #testing
VALUES('Madhu')
GO
CREATE TABLE #HoldDeleteData
([Name] VARCHAR(50))
DELETE FROM #testing
OUTPUT DELETED.* INTO #HoldDeleteData
WHERE [Name]='Madhu'
SELECT *FROM #HoldDeleteData
Comments