View the Table Definition - SQL Server (2024)

  • Article

Applies to: View the Table Definition - SQL Server (1) SQL Server 2016 (13.x) and later View the Table Definition - SQL Server (2) Azure SQL Database View the Table Definition - SQL Server (3) Azure SQL Managed Instance View the Table Definition - SQL Server (4) Azure Synapse Analytics View the Table Definition - SQL Server (5) Analytics Platform System (PDW)

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

Permissions

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

Use SQL Server Management Studio

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 select Properties from the shortcut menu. For more information, see Table Properties - SSMS.

Generate the CREATE TABLE script for an existing table

You can script out existing objects from the Object Explorer in SSMS. For more information, see Generate Scripts.

Use Transact-SQL

Use sp_help

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

  2. On the Standard bar, select New Query.

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

EXEC sp_help 'dbo.mytable';

Tip

By default, SSMS maps a keyboard shortcut for sp_help to the Alt-F1. Highlight the name of the object in a script you want to see, for example dbo.mytable, and hit Alt-F1 to execute the previous script sample. For more information, see SSMS keyboard shortcuts.

Use system catalog views

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

SELECT s.name as schema_name, t.name as table_name, c.* FROM sys.columns AS cINNER JOIN sys.tables AS t ON t.object_id = c.object_idINNER JOIN sys.schemas AS s ON s.schema_id = t.schema_idWHERE t.name = 'mytable' AND s.name = 'dbo';

Related content

View the Table Definition - SQL Server (2024)
Top Articles
Types of Multi-Factor Authentication (MFA)
Here's How Saving Just $5 per Day for 30 Years Can Create a $1 Million Portfolio | The Motley Fool
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Fr. Dewey Fisher

Last Updated:

Views: 5928

Rating: 4.1 / 5 (62 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Fr. Dewey Fisher

Birthday: 1993-03-26

Address: 917 Hyun Views, Rogahnmouth, KY 91013-8827

Phone: +5938540192553

Job: Administration Developer

Hobby: Embroidery, Horseback riding, Juggling, Urban exploration, Skiing, Cycling, Handball

Introduction: My name is Fr. Dewey Fisher, I am a powerful, open, faithful, combative, spotless, faithful, fair person who loves writing and wants to share my knowledge and understanding with you.