Re: select @@IDENTITY from MyTable
From: Vishal Parkar (REMOVE_THIS_vgparkar_at_yahoo.co.in)
Date: 03/10/04
- Next message: Ray Higdon: "Re: command to run sql statement"
- Previous message: Ray Higdon: "Re: Help for newbie with triggers"
- In reply to: Matt: "select @@IDENTITY from MyTable"
- Next in thread: Ray Higdon: "Re: select @@IDENTITY from MyTable"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 10 Mar 2004 09:08:53 +0530
hi matt,
@@identity function will return the "last inserted" identity value in the table. ideally it
will be equal to the total number of rows in the table(assuming you do not have any gaps in
the sequence of identity values.)
If you want to know how many rows that have been inserted by the insert statement you will
have to make use of function @@rowcount.
Ex:
-- Vishal Parkar vgparkar@yahoo.co.in
- Next message: Ray Higdon: "Re: command to run sql statement"
- Previous message: Ray Higdon: "Re: Help for newbie with triggers"
- In reply to: Matt: "select @@IDENTITY from MyTable"
- Next in thread: Ray Higdon: "Re: select @@IDENTITY from MyTable"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|