或
use test
gocreatetable test
(
id intidentity(1,1),
a varchar(100)
)
GOinsert test select ('a')
print IDENT_CURRENT('test')
--想在此列印出ID号的值! insert test select ('a')
--想在此列印出ID号的值! print IDENT_CURRENT('test')
insert test select ('B')
--想在此列印出ID号的值! print IDENT_CURRENT('test')
createtable test
(
id intidentity(1,1),
a varchar(100)
)
GOinsert test select ('a')
print@@identityinsert test select ('a')
print@@identityinsert test select ('B')
print@@identity
createtable test
(
id intidentity(1,1),
a varchar(100)
)
GOinsert test select ('a')
select@@identityinsert test select ('a')
select@@identityinsert test select ('B')
select@@identity