How can I get list of all tables in SQL Server database using query. My intention is to dynamically display this on a webpage.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try:
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.