Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Count fields in table

Author  Topic 

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2006-11-17 : 12:58:40
I've been searching and can't seem to find if this is even possible.
(Usually it is though)

Is there a way to get the count of how many fields (columns) are in a table?

Thanks,

Zath

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-11-17 : 13:19:35
select count(column_name)
from information_schema.columns
where table_name = 'yourTableName'



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Zath
Constraint Violating Yak Guru

298 Posts

Posted - 2006-11-17 : 13:31:43
Just what I've been looking for.

Thanks!!!!

Zath
Go to Top of Page
   

- Advertisement -