Sometime we need to fetch the information about the tables defined in an SQL Server database, we can fetch this information using the following query:
SELECT * FROM sys.tables
It will show information about all the tables in database.
You can use the following query to get the count number of tables in the database:
SELECT count(*) FROM sys.tables
Use the following query to get matching table names:
SELECT * FROM sys.tables WHERE name like '%Order%'
Tip: You can use the following query to get information about stored procedures:
SELECT * FROM sys.procedures