Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 878731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:48:42+00:00 2026-05-15T11:48:42+00:00

how to get all the tables and structure in a database in a table

  • 0

how to get all the tables and structure in a database in a table format using an sql query or stored procedure?

Structure is like below:

Sl No   FieldName   DataType    Size    Description
1      UserName    varchar     50  
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:48:42+00:00Added an answer on May 15, 2026 at 11:48 am

    This should do the trick. There is a bit more information in here but I think you may find it useful.

    Select  t.Table_Schema,
            t.Table_Name,
            c.Column_Name,
            IsNull(c.Column_Default, '') as 'Column_Default',
            c.Is_Nullable,
            c.Data_Type,
            IsNull(c.Character_Maximum_Length, IsNull(Numeric_Precision,'') + IsNull(Numeric_Scale, IsNull(DateTime_Precision,''))) as 'Size'
    
    From Information_Schema.Tables t
    
    Join Information_Schema.Columns c on    t.Table_Catalog = c.Table_Catalog
                                    And     t.Table_Schema = c.Table_Schema
                                    And     t.Table_Name = c.Table_Name
    
    Where t.Table_Type = 'BASE TABLE'
    
    Order by t.Table_Schema, t.Table_Name, c.Ordinal_Position
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have all my SQL stored in source control in the following structure Database
How do I get a list of all the tables defined for the database
I want to get table metadata for all table columns. Like type string(varchar2)/int/float/datetime and
I have a database that my program will query. it has 3 tables all
I need to get a list of all tables that are published for replication
Is there a way to get the count of rows in all tables in
Hi I have a 2 tables BlogPost and BlogComments I want to get all
How do you get a list of all the tables and use that list
What is the best way to get the names of all of the tables
I'm trying to LEFT JOIN two tables, to get a list of all rows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.