Friday, February 17, 2012

Dependencies within a transaction

If i were to have a dynamic SQL transaction, where i want to insert a
record, and use the ID generated for this record, in a subsequent query in
the same transaction , how do i do it ?
Regards,
Chak.How are you generating the id? Is that an IDENITITY? or GUID? See @.@.IDENTITY
and SCOPE_IDENTITY() in SQL Server Books Online. Also see:
http://vyaskn.tripod.com/retrieve_g...ke_identity.htm
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Chakra" <chakra@.smnetserv.com> wrote in message
news:OnfQHsgJFHA.2628@.tk2msftngp13.phx.gbl...
> If i were to have a dynamic SQL transaction, where i want to insert a
> record, and use the ID generated for this record, in a subsequent query in
> the same transaction , how do i do it ?
> Regards,
> Chak.
>

No comments:

Post a Comment