Solved

Print Out SQL Table Information

Posted on 2014-01-14
3
350 Views
Last Modified: 2014-01-14
I need a print out that describes all the fields, datatype and character size of a table in our sql 2005 server. Is this a built in function of sql server?
0
Comment
Question by:mickeyshelley1
3 Comments
 
LVL 25

Accepted Solution

by:
Lee Savidge earned 500 total points
ID: 39779487
sp_help 'tablename'
0
 
LVL 84
ID: 39779522
Not really, but you can use TSQL to get a lot of info:
SELECT     so.name AS [Table], sc.name AS [Column], st.name AS DataType, sc.isnullable AS [Nullable?]
FROM         sys.sysobjects AS so INNER JOIN
                      sys.syscolumns AS sc ON sc.id = so.id INNER JOIN
                      sys.systypes AS st ON sc.xtype = st.xtype
WHERE     (so.type = 'u')

Open in new window

There are also 3rd party utilities that will do this.
0
 

Author Closing Comment

by:mickeyshelley1
ID: 39779657
Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question