Tuesday, June 30, 2015

Query to get the names of all tables in SQL

SQL Server 
USE your_database SELECT name FROM sys.tables


SQL Server - get the fields info
SELECT TABLE_SCHEMA, TABLE_NAME, 
       COLUMN_NAME, substring(DATA_TYPE, 1,1) AS DATA_TYPE
FROM information_schema.COLUMNS  

ORDER BY TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION


MySQL
select TABLE_NAME from INFORMATION_SCHEMA.TABLES
where TABLE_TYPE = 'BASE TABLE'

10 comments:

Priya Tamil said...

Excellent .. Amazing .. I will bookmark your blog and take the feeds additionally? I’m satisfied to find so many helpful information here within the put up, we want work out extra strategies in this regard, thanks for sharing..

Hadoop Training in Chennai

Abiya Carol said...

This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.

PPC Services in Chennai

Shalini said...

Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.

digital marketing company in india

Vamshi Krishna said...

Thanks for posting such an interesting inforamtion, Please keep updates us and make us up to date....

sindhu said...

This is a great article, I have been always to read something with specific tips! I will have to work on the time for scheduling my learning.
SEO Company in Chennai

Nicole Bolton said...

Thanks for appreciating. Really means and inspires a lot to hear from you guys.I have bookmarked it and I am looking forward to reading new articles. Keep up the good work..Believe me, This is very helpful for me.
Fleet Management Software
Manufacturing ERP
Logistic ERP
Logistics Software
Human resources management software

Kalai chellam said...

Thanks for the informative article. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.

Restaurant in OMR
Apartments in OMR
Villas in OMR
Resorts in OMR

daily darpan said...

I love this blog . This is one of the best blog i ever seen. It's all about what i'm searching for. I love to read this blog again and again . Every time i enter this blog i get something new. This blog inspire me to write new blog. I write a blog name http://tutorialabc.com. It's about sql,c#,net etc

Coepd BA Trainings said...

We at Coepd declared Data Science Internship Programs (Self sponsored) for professionals who want to have hands on experience. We are providing this program in alliance with IT Companies in COEPD Hyderabad premises. This program is dedicated to our unwavering participants predominantly acknowledging and appreciating the fact that they are on the path of making a career in Data Science discipline. This internship is designed to ensure that in addition to gaining the requisite theoretical knowledge, the readers gain sufficient hands-on practice and practical know-how to master the nitty-gritty of the Data Science profession. More than a training institute, COEPD today stands differentiated as a mission to help you "Build your dream career" - COEPD way.

http://www.coepd.com/AnalyticsInternship.html

narayana p said...

It was so nice article. I was really satisfied by seeing this article. SQL server dba Online Training Bangalore