Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 @@Identity

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2000-09-18 : 00:34:46
youming writes "ID=422
strSQL = "Set Nocount on "
strSQL = strSQL + " Insert Topics (TopicName, SortOrder) VALUES ('X', -1) "
strSQL = strSQL + " select IdentityInsert=@@identity"
strSQL = strSQL + " set nocount off"

Set objRS = objConn.Execute(strSQL)

Response.Write objRS("IdentityInsert")

i have tried the above query to get the return @@identity
however i found that subsequent insert statement
using the same connection generate the error

*ERROR MESG**
HY000 Connection is busy with results for another hstmt.
The SQL Server ODBC driver allows only one active hstmt. For more information, see Using Default Result Sets.

i can skip the error if i open a new conn juz for the above query
and another for the rest of what i am doing...

what is the reason behind this?"

   

- Advertisement -