Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

what is better max() or scope_identity()

$
0
0

 

I need to retrieve identity value for inserted record in a stored procedure.

 

The value is then used to insert a record in a related table to establish relationship.

 

The stored procedure called from web application meaning, a lot of people can trigger the proc simultaneously.

 

My guess is scope_identity() should serve the purpose here and select max should not be used.

 

Any other thoughts?

 

Thanks

 

 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>