In this lesson, we will retrieve a list of all tables in our database and display them on the page.
This will return the following.
Name, ID, xtype, uid, info, status, base_schema_ver, etc...
Open SQL Server Management Studio.
Right-Click on the database.
Choose [New Query]
Paste the code below and click [Execute]
SELECT
*
FROM
SYSOBJECTS
WHERE
xtype = 'U';
GO
If you only need to get certain columns. Look at the column names in the output and add that to your select list.
Example
SELECT
Name, ID
FROM
SYSOBJECTS
WHERE
xtype = 'U';
GO
This will simply return the [Name] & [ID]