[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 421
  • Last Modified:

Getting SQL Table Schema

SQL :-

On highlighting the name of the Table in the SQL Management Studio - and pressing a short key - Alt + .. we would be able to get the Table Schema ..along with columns ..

I forgot the short code ..! to get the columns for a Table ..!

0
chokka
Asked:
chokka
  • 5
  • 5
1 Solution
 
knightEknightCommented:
I don't know about that shortcut, but you can right-click the table and select:
Script Table as / CREATE To / New Query Editor Window
0
 
chokkaAuthor Commented:
I am aware about the Create Script

Like SP_Tables .. do we have any inbuilt functions

or from Information_Schema , is there any way for me to get it on Management Studio ..!
0
 
knightEknightCommented:
Do you mean something like this?

SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, ORDINAL_POSITION, COLUMN_NAME, DATA_TYPE, COLUMN_DEFAULT
FROM [MyCatalogName].INFORMATION_SCHEMA.COLUMNS
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
chokkaAuthor Commented:
KinghtEKnight :- Thank you ..! This is what i expected through Short Key ..!

Your comment is right. I have to wait couple of more comments for Short Key ..! I actually forgotten the Short Key ..which i used to do very frequently ..!
0
 
knightEknightCommented:
I'm looking forward to learning it myself!
Also, if you do  SELECT *  in the previous query you will see more good stuff...
0
 
chokkaAuthor Commented:
knightEknight:  


1) Type Table Name on SQL Management Studio

2) Highlight the Table Name

3) Press Alt + F1

You can see entire Table Schema !!!!

0
 
knightEknightCommented:
Thanks!  But it doesn't seem to work for me ...

In Management Studio (SQL Server 2005/8), in the Object Explorer I expand the database / Tables and click on (highlight) a table name.  ALT-F1 - nothing happens.  Am I doing it right?
0
 
chokkaAuthor Commented:
First type

Select * from TableA

Now double click on word :  TableA

This will be highlighted automatically

Once it got highlighted - Alt + F1 will give you entire result.

This runs only on Management Studio and not Object Browser !!!
0
 
knightEknightCommented:
Got it - it works!  Thanks!
0
 
chokkaAuthor Commented:
Glad to hear !!!
0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now