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
 SQL Server Development (2000)
 Column Count

Author  Topic 

danasegarane76
Posting Yak Master

242 Posts

Posted - 2007-05-29 : 07:02:26
Dear All,
How can get the column count in a particular table(like 10 or 12 etc)

Thanks in Advance
Dana

Kristen
Test

22859 Posts

Posted - 2007-05-29 : 07:12:53
[code]
SELECT MAX(colid)
FROM sysobjects AS O
JOIN syscolumns as C
ON C.id = O.id
WHERE O.name = 'Mytable'
[/code]
Kristen
Go to Top of Page

danasegarane76
Posting Yak Master

242 Posts

Posted - 2007-05-29 : 08:21:27
Thanks Kristen :)
Go to Top of Page
   

- Advertisement -