--Decalring temp table
DECLARE @OUTPUTTABLE Table
(
ID INT,
NAME VARCHAR(100),
OLDNAME VARCHAR(100),
PRICE Decimal(18,2),
OLDPRICE Decimal(18,2)
);
UPDATE dbo.SourceTable
SET Name='TestUpdate',
Price=64
OUTPUT
inserted.ID,
inserted.Name,
deleted.Name,
inserted.Price,
deleted.Price
INTO @OUTPUTTABLE(ID,NAME,OLDNAME,PRICE,OLDPRICE)
WHERE ID=3
SELECT * FROM [EVSSQL].[dbo].[SourceTable]
SELECT * FROM @OUTPUTTABLE
No comments:
Post a Comment