文章出處
文章列表
SELECT obj.name tablename, CAST ( CASE WHEN (SELECT COUNT(1) FROM sys.indexes WHERE object_id= obj.OBJECT_ID AND is_primary_key=1) >=1 THEN 1 ELSE 0 END AS BIT) HasPrimaryKey from 數據庫名.sys.objects obj where type='U' or type='V' order by obj.name
文章列表
全站熱搜