Making query to list all the Tables in Database

Lets say for example. You have multiple tables lets say 50. You create a table which which has 3 columns (table_name, count ). To explain those columns, table_name is the name of the table, count is the number of records that are unauthorized assuming in all the tables you have a field called auth_status and the value “U” which stands for Unauthorized so it is counting number of records in that table with auth_status value “U”
sample table data e.g

table_name   | count  | 
tbl_users    |  3
tbl_clients  |  3
tbl_fruits   |  3

assuming those are 50 tables in your DB im using MSSQL as my Database. So that table and its records are viewed from a template and if possible i can have a link to take me to that table from a template. How can this be best done.

Database table or HTML table?

Re: the question in the title, look into INFORMATION_SCHEMA.TABLES and friends in the MSSQL documentation.

1 Like

Both of them because im querying and displaying on an html template.

Thanks alot it works