Sunday, March 25, 2012

count fields of a table

How can I find out how many columns in a table ?
Thanksselect * from information_schema.columns where table_name = 'mytable'
or
select count(*) from information_schema.columns where table_name = 'mytable'
hth.
Mark
www.dovetaildatabases.com
"Catelin wang" <cwang@.cemstone.com> wrote in message
news:uEcty0a%23EHA.1604@.TK2MSFTNGP12.phx.gbl...
> How can I find out how many columns in a table ?
> Thanks
>|||Thanks.
"Mark" <field027@.idonotlikejunkmail.umn.edu> wrote in message
news:uEZqZ5a%23EHA.2452@.TK2MSFTNGP14.phx.gbl...
> select * from information_schema.columns where table_name = 'mytable'
> or
> select count(*) from information_schema.columns where table_name =
'mytable'
> hth.
> Mark
> www.dovetaildatabases.com
> "Catelin wang" <cwang@.cemstone.com> wrote in message
> news:uEcty0a%23EHA.1604@.TK2MSFTNGP12.phx.gbl...
>

No comments:

Post a Comment