From: DavidC on 21 Jun 2010 14:33 I have a stored procedure that does 3 INSERTs and I want to use the new identity value in each one to pass to the next INSERT. Can I use SCOPE_IDENTITY() on each one without a problem? For example: INSERT INTO .... SET @newIdent = SCOPE_IDENTITY() INSERT INTO ..... SET @newIdent2 = SCOPE_IDENTITY -- David
From: Tom on 21 Jun 2010 14:41 On Jun 21, 2:33 pm, DavidC <dlch...(a)lifetimeinc.com> wrote: > I have a stored procedure that does 3 INSERTs and I want to use the new > identity value in each one to pass to the next INSERT. Can I use > SCOPE_IDENTITY() on each one without a problem? For example: > > INSERT INTO .... > > SET @newIdent = SCOPE_IDENTITY() > > INSERT INTO ..... > > SET @newIdent2 = SCOPE_IDENTITY > > -- > David Yes that is not a problem.
|
Pages: 1 Prev: Confusing varchar(max) ... Next: Insert Data Generate Date into an SSRS Report Header |