All Forums Database
Meem 24 posts Joined 05/07
03 Aug 2007
How to find the number of columns in a table?

Hi All,Please help me to find the count of columns in a table.Thanks & Regards,Md. Siddique

foxbat 27 posts Joined 06/07
03 Aug 2007

The following SQL will do the job for you.SELECT DatabaseName, TableName, Count(columnname) As ColumnCountFROM DBC.ColumnsWHERE DatabaseName='E_CompanyDB' AND TableName='Employee'GROUP BY 1,2;-Foxbat

03 Aug 2007

sel count(*) from dbc.tvfields where tableid =(Select tvmid from dbc.tvm where tvmname = 'employee'and databaseid = (sel databaseid from dbc.dbase where databasename = 'first_ex'));

Meem 24 posts Joined 05/07
05 Aug 2007

Thanks for ur query

You must sign in to leave a comment.