aSP获取Sql中刚插入数据库ID

 set rs2=server.CreateObject("adodb.recordset")
   sql2="SELECT @@IDENTITY as selectid from product"
   rs2.open sql2,conn,1,1
   if not rs2.eof and not rs2.bof then
   selectid=rs2("selectid")
   else
   selectid=0
   end if
   rs2.close
   set rs2=nothing  

你可能感兴趣的:(sql,数据库,asp)