Hi, I need to retreive the detailed structure for a given table (field_name, type, length and isnull ?).
I have this query that gives me the columns names:
select Column_name = isnull(c.name, 'NULL'),
Type = isnull(convert(char(30), x.xtname),
isnull(convert(char(30),
get_xtypename(c.xtype, c.xdbid)),t.name))
from syscolumns c, systypes t, sysxtypes x
where c.id = object_id('table_name')
and c.usertype *= t.usertype
and c.xtype *= x.xtid
I tried with the systypes.coltype but doesnt work as I want.
Please anyone can help me with this issue ?
thanks.
I have this query that gives me the columns names:
select Column_name = isnull(c.name, 'NULL'),
Type = isnull(convert(char(30), x.xtname),
isnull(convert(char(30),
get_xtypename(c.xtype, c.xdbid)),t.name))
from syscolumns c, systypes t, sysxtypes x
where c.id = object_id('table_name')
and c.usertype *= t.usertype
and c.xtype *= x.xtid
I tried with the systypes.coltype but doesnt work as I want.
Please anyone can help me with this issue ?
thanks.