CREATE PROCEDURE customers_add @Name Varchar(50),@newkey INTEGER OUTPUT AS BEGIN TRANSACTION INSERT INTO Customers(name) VALUES (@name) SELECT @newKey = @@IDENTITY COMMIT TRANSACTIONThis method of course assumes the use of identity columns...which should be used for primary keys any way. Does @@RowCount work? It appears to. However, if you are looking for the BEST way to handle this, why not reference an environmental variable that specfically deals with new records. If the insert fails, @@Identity evaluates to null. The use of output variables is an extremely effective technique for deterimining success and failure. And, you only need to make 1 call...