Learning About Tables

SQL Server provides several stored procedures that list the tables available in a database and that describe how those tables are related. The following sections describe these procedures.

sp_tables

The sp_tables stored procedure lists the tables in a database. The following text shows the output generated by this procedure for the database OrderEntry:

 TABLE_QUALIFIER TABLE_OWNER TABLE_NAME TABLE_TYPE REMARKS =============== =========== =================== ============ ======= OrderEntry dbo syscolumns SYSTEM TABLE NULL OrderEntry dbo syscomments SYSTEM TABLE NULL OrderEntry dbo sysdepends SYSTEM TABLE NULL OrderEntry dbo sysfilegroups SYSTEM TABLE NULL OrderEntry dbo sysfiles SYSTEM TABLE NULL OrderEntry dbo sysfiles1 ...

Get Visual Basic® .NET Database Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.