Viewing a Table

After you have created the tables in a database, you may have to find information about the table properties, such as the name or data type of a column or the nature of its indexes, but most importantly, you will have to view the data in the table.

You can also display the dependencies of the table to determine which objects, such as views, stored procedures, and triggers, depend on the table. If you make any changes to the table, dependent objects may be affected.

To view the definition of a table

sp_help (Transact-SQL)

To view the data in a table

SELECT (Transact-SQL)

To obtain information about tables

sys.tables (Transact-SQL)

To obtain information about table columns

sys.columns (Transact-SQL)

COLUMNPROPERTY (Transact-SQL)

To obtain information about table columns that are computed

sys.computed_columns (Transact-SQL)

To view the dependencies of a table

sys.sql_expression_dependencies (Transact-SQL)

sys.dm_sql_referenced_entities (Transact-SQL)

sys.dm_sql_referencing_entities (Transact-SQL)