How can I get list of all tables in SQL Server database using query. My intention is to dynamically display this on a webpage.
Try:
SELECT [name] from sys.tables
This should give you what you want. You'll then need to call it from your webpage to display in required format.
You may want to see:
Will probably help you in what you are trying to do.
Also - you may want to see SQL Server: should I use information_schema tables over sys tables? for sys.tables vs INFORMATION_SCHEMA.
INFORMATION_SCHEMA is SQL92 standard, but I personally prefer sys.tables in MS-SQL universe as it seems (to me atleast) well structured and have all relevant information, e.g. index information is just not available in INFORMATION_SCHEMA.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With