Anybody knows of an equivalent of mysql_insert_id() in MSSQL?
I just inserted a record and need the current ID of this record.
Thx
S.
mysql_insert_id()
Moderator: General Moderators
MAY BE LIKE THAT
I just though of a way of doing it, but it might be a bit buggy...
By selecting the last id created, I get the right record number.
select top 1 ID from company order by ID desc
Trouble is if 2 person add a new record on the same time....
Anybody think of a different way?
By selecting the last id created, I get the right record number.
select top 1 ID from company order by ID desc
Trouble is if 2 person add a new record on the same time....
Anybody think of a different way?