转,【小小问题集锦12之---查找具有IDENTITY列的表和其列】

it2022-05-09  29

 

转自,https://blog.csdn.net/feixianxxx/article/details/5299902

/*----------------------

*问题描述:如何知道数据库中存在IDENTITY属性的表以及确定该表中的IDENTITY属性列名?*/

use dbname

go

Select  table_name as  表名,column_name  as  列名  

from  information_schema.columns        

where  columnproperty(object_id(table_name),column_name,'IsIdentity')=1  

转载于:https://www.cnblogs.com/ijunxiong/articles/8779781.html


最新回复(0)