declare @Table_name varchar(60) 
set @Table_name = 'aa'; 
Select so.name Table_name, --表名字 
sc.name Iden_Column_name, --自增字段名字 
ident_current(so.name) curr_value, --自增字段当前值 
ident_incr(so.name) incr_value, --自增字段增长值 
ident_seed(so.name) seed_value --自增字段种子值 
from sysobjects so 
Inner Join syscolumns sc 
on so.id = sc.id 
and columnproperty(sc.id, sc.name, 'IsIdentity') = 1 
Where upper(so.name) = upper(@Table_name) 




Select so.name Table_name,sc.name Iden_Column_name,ident_current(so.name) curr_value,
ident_incr(so.name) incr_value,ident_seed(so.name) seed_value from sysobjects so 
Inner Join syscolumns sc 
on so.id = sc.id and columnproperty(sc.id, sc.name, 'IsIdentity') = 1 where upper(so.name) = upper('Table1')

相关文章:

  • 2021-12-30
  • 2021-07-17
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-29
  • 2022-12-23
  • 2022-02-07
  • 2021-10-06
  • 2022-02-11
  • 2021-12-01
相关资源
相似解决方案