Hello all. I want to know whether it is possible to retrieve list of all tables found in a particular database titled 'Company'? It have got several tables with the names, Suppliers, Customers, etc etc. Just like Oracle, where you retrive all tables using select * from tab; . Is it possible to do the same in MS SQL???

Recommended Answers

All 5 Replies

Sorry Mr.RaptorSix. But we are in MS SQL. Not in MySQL. Try again. I owe you. Thanks in advance. Happy New Year.

There are a couple of ways to do it, depending on what version of SQL Server you are using and how detailed you need to get. First, in your query tool of choice (usually Management Studio) point to the database you're interested in, then use one of these:

--for SQL2000 or later, you can use either:
select * from sysobjects where type = 'U'
--or
select * from INFORMATION_SCHEMA.TABLES

--for SQL2005 or later, you can also use this:
select * from sys.tables

Hope this is what you're looking for!

Sorry Bnitishpai, i read your post a little too fast! Hopefully BitBit has you covered.

Bitbit was right.. thanks dude i have the same problem too...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.