DECLARE @MyTableVar table(
ScrapReasonID smallint,
Name varchar(50),
ModifiedDate datetime);
INSERT Production.ScrapReason
OUTPUT INSERTED.ScrapReasonID, INSERTED.Name, INSERTED.ModifiedDate
INTO @MyTableVar
VALUES (N 'Operator error ', GETDATE());
SELECT ScrapReasonID, Name, ModifiedDate FROM @MyTableVar;
ScrapReasonID smallint,
Name varchar(50),
ModifiedDate datetime);
INSERT Production.ScrapReason
OUTPUT INSERTED.ScrapReasonID, INSERTED.Name, INSERTED.ModifiedDate
INTO @MyTableVar
VALUES (N 'Operator error ', GETDATE());
SELECT ScrapReasonID, Name, ModifiedDate FROM @MyTableVar;
分类: MSSQL
本文转自 Fanr_Zh 博客园博客,原文链接:http://www.cnblogs.com/Amaranthus/archive/2011/05/27/2059679.html,如需转载请自行联系原作者