DECLARE @t2 AS TABLE(id INT)
INSERT INTO dbo.EntityMaster
(EntityType)
OUTPUT INSERTED.EntityId INTO @t2
SELECT 'G' FROM #tmp
#tmp is a temporary table that contains data loaded from an xml. I need to generate EntityId for each record contained in #tmp. It can be done by inserting record first into EntityMaster table then insert this entityid back into #tmp for each record.
Instead of inserting record into @t2, I need to update #tmp for each record.
Any possibility?