On Mon, 2002-06-03 at 13:06, tomasz konefal wrote:
>    i need to know what the primary key is for an insert into a table so
> that i can add another bit of data into another table which has a
> foreign key to this primary table.  this primary key is a serial number
> that automatically increments on insert, so i don't know ahead of time
> what the number will be.  as far as i can tell i should be able to use
> cursors for this, but i don't know the syntax which i should use for
> MSSQL-2000.

Try 
        select @@identity

Michael
-- 
Michael Peppler                              Data Migrations, Inc.
[EMAIL PROTECTED]           *or*          [EMAIL PROTECTED]
http://www.mbay.net/~mpeppler
International Sybase User Group: http://www.isug.com

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to