MS SQL Show Tables in a Database (Microsoft SQL)

In MS SQL use the following SQL to show all tables in the selected database. This is the equivalent of MySQLs show all tables.

MS SQL queries for show table:

Using this query syntax you can display all tables in a MS SQL database. Hmmm… I think I like the MySQL way for showing all tables better:

Drop me a comment if this helped your or if you feel I missed something, thanks for reading.

9 Comments

  • Rishi Pandit says:

    query SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ‘BASE TABLE’ worked in ms-sql. Thanks

  • Vladimir says:

    Thanks for this. It’s help optimize my .net code. Nice! =)

  • Mannan says:

    None of the querries are working my database name is Mannan I want to display the table sin this database plzz help.

    • shoaib momin says:

      SELECT * FROM INFORMATION_SCHEMA.TABLES
      this query work on sql2000 , 05 on 2008 also.
      with the above query you can use lot of ting such as tables, column,view…..etc
      you will get the all the option if you will be using the sql managment 2008…..

  • IvanJ says:

    SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = ‘BASE TABLE’

    worked in SQL server 2005.

    Thanks

  • Shawn Welch says:

    Of course everything is more complicated with Microsoft.

    • Vidar says:

      THATS was my comment and first thought. As I was familiar with MySQL I was surprised that a multibillionary mega companie like M$ couldn’t spare a few bucks for adding the SHOW command to their database solution.

      But you know, inteligence is stored between the ears, not in a wallet…

  • Bhavin says:

    Do you know how to display all tables in single query on MySQL?