Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 12890

Insert with Output clause

$
0
0

INSERT INTO Orders

OrderName, OrderDate

OUTPUT INSERTED.OrderId

SELECT OrderName, OrderDate

FROM @tvp (table valued parameter)

I want to include other columns from the tvp that are not inserted into the table in my output clause.

For e.g. OUTPUT INSERTED.OrderId, @tvp.OrderGuidId

This throws a compilation error. Is there any other way to get around it?


Anonymous


Viewing all articles
Browse latest Browse all 12890

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>