Monday, March 19, 2012

FROM INSERTED

Can you use 'from inserted' to select data from the last row inserted in a
stored procedure...You can only reference the INSERTED and DELETED virtual tables in a trigger.
In principle you could insert the data into a local temp table in the
trigger and then call a proc, which would access that temp table. I would
recommend you try to avoid that, however. Any reason you can't put your
procedure logic in the trigger itself?
David Portas
SQL Server MVP
--|||The inserted table is only accessible from within a trigger. Are you trying
to achieve something from a trigger? If so, could you post some sample table
stuctures, test data and desired output, so that we can try to come up with
a query?
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"docsql" <docsql@.noemail.nospam> wrote in message
news:ugD%23VGmWFHA.2876@.TK2MSFTNGP10.phx.gbl...
> Can you use 'from inserted' to select data from the last row inserted in a
> stored procedure...
>

No comments:

Post a Comment