Solved

Print Out SQL Table Information

Posted on 2014-01-14
3
346 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
Comment Utility
sp_help 'tablename'
0
 
LVL 84
Comment Utility
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
Comment Utility
Thanks
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now