我想在代码中执行此操作,而不是使用 ALT+F1。
您也可以这样做:
select columnproperty(object_id('mytable'),'mycolumn','IsIdentity')
如果是恒等则返回 1,否则返回 0。