peter.row (2/24/2011)
Why use the output syntax, table variable and dynamic sql?Wouldn't the following be simpler (no permissions issue on table if user running it only has access to SP either) :
insert into ...
set @outputId = scope_identity()
This was my original thought as well, maybe I am missing something.