How do I list the available tables in a database I'm
querying?

Answers were Sorted based on User's Feedback



How do I list the available tables in a database I'm querying?..

Answer / guest

You can get a list of tables in a database by calling the
INFORMATION_SCHEMA.Tables view like this:

SELECT * FROM information_schema.tables

Is This Answer Correct ?    7 Yes 0 No

How do I list the available tables in a database I'm querying?..

Answer / shraddha

sp_tables

Is This Answer Correct ?    3 Yes 0 No

How do I list the available tables in a database I'm querying?..

Answer / kumar.t

Simple query

To Display only user created table.

Select * from sysobjects where xtype='u'

To Display all table.

Select * from sysobjects

Is This Answer Correct ?    3 Yes 0 No

How do I list the available tables in a database I'm querying?..

Answer / sanjeev kumar

First Method:

select table_name from information_schema.tables


Second Method:

Select Name from sysobjects where xtype='u'

Note: here 'u' means user created

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

Hi Can any one tell me the Good institute to learn SQL esp for Data Base Testing or SQL from scratch to the proficiency level in Hyederabad and facult also. Thankyou well in advance

6 Answers  


What is storeprocedure?Tell me synatx for how to write stored procedure.

1 Answers   Cap Gemini,


Explain features and concepts of analysis services?

1 Answers  


What is merge statement?

1 Answers  


What is the use of Port no?

1 Answers   Wipro,


What is 2nf example?

1 Answers  


what is the maximum size of sql row in mssql?

1 Answers  


What is a db view?

1 Answers  


It is important form e to get the information from log files of applications executed by the task scheduler? Does sql studio save these log files? : sql server management studio

1 Answers  


What are scalar functions?

1 Answers  


What are the 7 disadvantages to a manual system?

1 Answers  


Explain about thread and memory management process of SQL?

1 Answers  


Categories