Yes.
Use the OUTPUT
clause
example from the MSDN link:
The following example inserts a row into the ScrapReason table and
uses the OUTPUT clause to return the results of the statement to the
@MyTableVar table variable. Because the ScrapReasonID column is
defined with an IDENTITY property, a value is not specified in the
INSERT statement for that column.
USE AdventureWorks2008R2;
GO
DECLARE @MyTableVar table( NewScrapReasonID smallint,
Name varchar(50),
ModifiedDate datetime);
INSERT Production.ScrapReason
OUTPUT INSERTED.ScrapReasonID, INSERTED.Name, INSERTED.ModifiedDate
INTO @MyTableVar
VALUES (N'Operator error', GETDATE());
--Display the result set of the table variable.
SELECT NewScrapReasonID, Name, ModifiedDate FROM @MyTableVar;
--Display the result set of the table.
SELECT ScrapReasonID, Name, ModifiedDate
FROM Production.ScrapReason;
GO
(Assuming you are using Sql Server)
-==========================