Solved

Print Out SQL Table Information

Posted on 2014-01-14
3
349 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

777 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