View the Table Definition

Applies to: yesSQL Server 2016 (13.x) and later YesAzure SQL Database YesAzure SQL Managed Instance yesAzure Synapse Analytics yesAnalytics Platform System (PDW)

You can display properties for a table in SQL Server by using SQL Server Management Studio or Transact-SQL.

In This Topic

Before You Begin

Security

Permissions

You can only see properties in a table if you either own the table or have been granted permissions to that table.

Using SQL Server Management Studio

To show table properties in the Properties window

  1. In Object Explorer, select the table for which you want to show properties.

  2. Right-click the table and choose Properties from the shortcut menu. For more information, see Table Properties - SSMS.

Using Transact-SQL

To show table properties

  1. In Object Explorer, connect to an instance of Database Engine.

  2. On the Standard bar, click New Query.

  3. Copy and paste the following example into the query window and click Execute. The example executes the system stored procedure sp_help to return all column information for the specified object.

EXEC sp_help 'dbo.mytable';

For more information, see sp_help (Transact-SQL).

You could alternatively query the system catalog views directly to query object metadata information about tables, schema, and columns. For example:

SELECT s.name, t.name, c.* FROM sys.columns AS c
INNER JOIN sys.tables AS t ON t.object_id = c.object_id
INNER JOIN sys.schemas AS s ON s.schema_id = t.schema_id
WHERE t.object_id = object_id('mytable') AND s.name = 'dbo';

For more information, see: