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

How to handle error or exception in sql?

0 Answers  


What's the maximum size of a row?

4 Answers   IBM,


How to enforce security in sql server? : sql server security

0 Answers  


Can a table have 2 primary keys?

0 Answers  


What are the all different types of Joins in SQL Server 2000, Anybody can explain each join with definition..Thanks in advance....

9 Answers   DELL, i Tech, Infosys, Siemens, TCS,






What is difference between createstatement and preparedstatement?

0 Answers  


Without Using Cursors , How to Select the Selected row??

3 Answers   CarrizalSoft Technologies, Wipro,


What do you understand by physical_only option in dbcc checkdb?

0 Answers  


What xml support does the sql server extend?

0 Answers  


If any stored procedure is encrypted, then can we see its definition in activity monitor?

0 Answers  


What is dml command?

0 Answers  


Tell me time data type, datetime2, datetimeoffset data type in sql server 2008?

0 Answers  


Categories