How to get list of all tables that has identity columns

前端 未结 5 787
小蘑菇
小蘑菇 2021-02-04 00:21

I would like to learn how to fetch list of all tables that has identity columns from a MS SQL database.

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-04 00:33

    Select OBJECT_NAME(object_Id) Rrom sys.identity_columns where is_identity = 1;

提交回复
热议问题