All Forums Database
sam_dhse 11 posts Joined 07/10
20 Mar 2013
Metadata information for a view

If i query dbc.columns for a particular table within a database it gives me column data type with its length.However if i have a custom view that is build on top of lets suppose 2 tables and if i query dbc.columns for this view it won't give me the column datatypes or length of columns in the view.
Any suggestion on how can i get column datatype and length of the columns in this custom view.

KS42982 137 posts Joined 12/12
21 Mar 2013

You can try something like below -
SELECT TOP 1 TYPE(col1),TYPE(col2),...,TYPE(coln) FROM dbname.viewname

sam_dhse 11 posts Joined 07/10
22 Mar 2013

Thank you

Fred 1096 posts Joined 08/04
25 Mar 2013

HELP COLUMN dbname.viewname.*;

You must sign in to leave a comment.