in reply to Re: Re: mssql query
in thread mssql query

I'd use a semicolon between the first and the second SQL statement
No semicolon needed between statements with MS-SQL, and in fact the semi-colon would be a syntax error with Sybase.
...a dirty and bad looking solution is to have a separate statement MAX() the value of the identity...
Unless you use a transaction around the insert and the select max() (which effectively single threads inserts) then there is no guarantee that the max() will be the value that you just inserted (unless of course you know that you are the only process inserting data to that particular table).

Michael