« Working with collections | Main | HTML viewer using AxWebBrowser and IHTMLDocument2 »

SQL identity columns and SCOPE_IDENTITY vs. @@IDENTITY, Rowguids

Use SCOPE_IDENTITY() instead of the @@IDENTITY system function if there’s any chance of a trigger doing an insert to a table with an identity column in the interval. Identity columns complicate replication.

Rowguid’s are easier for replication. Since there’s no SCOPE_IDENTITY() equivalent, pre-allocate new guids for subsidiary table inserts.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)