GeekInterview.com
Series: Subject:
Question: 37 of 80

To display list of tables in database

How to display list of tables from a particular database in MS-SQL
How to display description of that particular table?
Asked by: vijju31_1985 | Member Since Jun-2007 | Asked on: Feb 26th, 2008

View all questions by vijju31_1985

Showing Answers 1 - 3 of 3 Answers
LGSGEEK

Answered On : Mar 29th, 2008

View all answers by LGSGEEK

Submit a query on the SYS.TABLES table to get all of the data about the tables in a specific database.  Be sure to specify the database that you are targeting.

USE -- Specify your target database name (without the brackets)

GO

 SELECT * FROM SYS.TABLES
GO

  
Login to rate this answer.

use
sp_help

It displays all the tables created in that database

  
Login to rate this answer.
cybersavvy

Answered On : Feb 19th, 2009

View all answers by cybersavvy

To Display list of tables in the database:
SELECT * FROM INFROMATION_SCHEMA.TABLES WHERE TYPE='basetable'

To describe the structure of a particular table
SP_HELP table_name;

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.