What's Here?
- Members: 119,689
- Replies: 437,855
- Topics: 67,745
- Snippets: 2,424
- Tutorials: 642
- Total Online: 2,088
- Members: 93
- Guests: 1,995
Who's Online?
|
Welcome to Dream.In.Code |
|
|
Getting Help is Easy!
Join 119,689 Programmers for FREE! Ask your question and get quick answers from experts. There are 2,088 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!
|
Since MSSQL does not offer the describe command, it can be frustrating digging through the columns. Maybe this can help!
Found at http://www.crydust.be/blog/2006/12/26/mssql-lacks-describe-statement : and added constraint_type
|
Submitted By: no2pencil
|
|
|
Rating:
|
|
Views: 305 |
Language: mySQL
|
|
Last Modified: July 2, 2008 |
|
Instructions: change tablename to the appropriate name of the table you are getting details on. |
Snippet
SELECT
column_name
, data_type +
COALESCE(
'(' + CAST(character_maximum_length AS VARCHAR) + ')'
, '(' + CAST(numeric_precision AS VARCHAR) + ')'
, ''
)
, column_default
, constraint_type
, is_nullable
FROM
information_schema.columns
WHERE
table_name = 'tablename';
Copy & Paste
|
|
|
Programming
Web Development
Reference Sheets
Bye Bye Ads
Free DIC T-Shirt
Related Sites
Monthly Drawing
Partners
Top Contributors
Top 10 Kudos This Month
|