Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

List columns data type and size for every table in a database Expand / Collapse
Author
Message
Posted Wednesday, September 9, 2009 6:07 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 22, 2012 9:07 AM
Points: 0, Visits: 46
Comments posted to this topic are about the item List columns data type and size for every table in a database
Post #785434
Posted Monday, April 12, 2010 5:51 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, April 24, 2010 2:52 PM
Points: 1, Visits: 17
Neat tool, thank you.

It seems to work for the tables under the dbo schema, but not other schemas in the database. *shoot*

In fact, I'm just looking for an easy way to loop through all the columns of a table, getting the name and type, and the primary key. Any help appreciated. Thanks! (In fact, I'm looking to do this for the inserted table in a trigger.)

This could be done easily from Java with MySQL using the MYSQL_FIELD structure and a few function calls (mysql_num_fields, mysql_fetch_field, etc.) But I'm looking for a quick way to do it just with MS T-SQL.
Post #902077
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse