如何向数据库理插入的同时读出该id号?


我使用的sql  server7.0  数据库,数据源使用的是文件dsn.最好是能用存储过程解决,直接用sql语句也可。  
     ---------------------------------------------------------------  
 
try  
sql="execute  sp_insertproduct  ''"  &chrproductname  &  "'',''"  &txtdescription  &"'',''"  &chrproductimage    &"'',"&intprice  &","&intactive  &  ";select  @@identity  as  ''id''"  
set  rsproduct=dbproduct.execute(sql)  
set  rsproduct=rsproduct.nextrecordset  
response.write  rsproduct("id")  
posted on 2005-03-12 21:28  轻松逍遥子  阅读(198)  评论(0)    收藏  举报