Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

When use Database Diagrams in a simple database, SQL Server create a dbo.sysdiagrams table in the Table\Systam Tables node (in Microsoft management studio\object explorer). But sysdiagrams table marked as user table in SQL Server. you can get user table by below query.

SELECT *  FROM sys.tables t WHERE OBJECTPROPERTY(t.object_id,'IsUserTable') = 1 

enter image description here

I don't know that sysdiagram table is a system table or is a user table.

Exists microsoft_database_tools_support with value 1 In the extended property of sysdiagram, that determine this table created automatically.

enter image description here

like image 847
mehdi lotfi Avatar asked Mar 08 '14 14:03

mehdi lotfi


People also ask

What is DBO Sysdiagrams?

SQL Server dbo. sysdiagrams is a user table or system table - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing organizational knowledge.

What are system tables in SQL Server?

System Tables are a special type of table in which the SQL Server Engine stores information about the SQL Server instance configurations and objects information, that can be queried using the system views.

Which types of tables are used in SQL Server?

1 Answer. There are three types of tables in SQL such as base, view, and merged. The data in these tables has different properties from other tables.

How will you create a table with DBO schema?

By default, the table is contained in the dbo schema. To specify a different schema for the table, right-click in the Table Designer pane and select Properties as shown in the following illustration. From the Schema drop-down list, select the appropriate schema.


1 Answers

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] 
like image 78
Anon Avatar answered Jan 12 '23 13:01

Anon