How to List Tables in SQL Server
You can use the following SQL query to retrieve all table names:
SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='YourDatabaseName'
Replace ‘YourDatabaseName’ with the name of the database you want to query in the above query. This statement will return the names of all tables in the specified database.