SQL Server dbo.sysdiagrams is a user table or system table

Deadly 提交于 2019-12-04 22:36:32
Alain Tésio

System tables are used internally by the SQL Server, they are the same in every user database.

sysdiagrams is not a system table from the server point of view.

But SQL Server Management Studio creates it to store the diagram data, so it also categorizes it as a system table.

You can exclude such kinda system tables using the extended attribute you mentionned.

Anon

Management Studio utilizes the following in its determination of "System Objects" where "tbl" is sys.tables:

CAST(
 case 
    when tbl.is_ms_shipped = 1 then 1
    when (
        select 
            major_id 
        from 
            sys.extended_properties 
        where 
            major_id = tbl.object_id and 
            minor_id = 0 and 
            class = 1 and 
            name = N'microsoft_database_tools_support') 
        is not null then 1
    else 0
end          
             AS bit) AS [IsSystemObject]
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!