2007-01-22

The latest identity ID

sql="insert into table(name) values(‘Tom’);select @@IDENTITY"
Dim id as Int32 = CType(cmd.ExecuteScalar(conn, CommandType.Text, sql),Int32)
 
if DB is publisher or subscript ==> select SCOPE_IDENTITY()

沒有留言:

張貼留言