Home Forums SQL Server 2008 T-SQL (SS2K8) Require serial access to table, Stored Procedure, TABLOCKX RE: Require serial access to table, Stored Procedure, TABLOCKX

  • You could use the OUTPUT clause in the INSERT statement and capture the primary key together with the values inserted in a table variable.

    See BOL (BooksOnLine) for an example (keyword OUTPUT).

    Another solution could be a computed column that would generate the new name. That way you wouldn't even have to worry about the additional update statement...



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]