Is it possible to insert columns of different tables in the OUTPUT clause of an INSERT statement, such as:
DECLARE @insertedrecords TABLE (Id int, [Guid] uniqueidentifier);
INSERT INTO mytable
(column names here...)
OUTPUT inserted.id_no, b.[Guid] INTO @insertedrecords
SELECT
column names here...
FROM @myTVP b
Currently, using the above I get the following error:
The multi-part identifier "b.Guid" could not be bound.