方法一:
select * from tblNoticeRelate
Insert Into tblNoticeRelate (NoticeID, intRelatedID, RelatedType) Values (1,2,'USER')Select @@IDENTITY As uNewID
方法二: (在.NET代码中实现)
strSQL = "Select Ident_Current('[Notice_tblNoticeMaster]') As AID"
objCmd = New SqlClient.SqlCommand (strSQL, objConn, objTran)
intAutoID = Cint(objCmd.ExecuteScalar.ToString)
Return intAutoID