title: How to find columns count of any table in any database from sql server master database?
body: <p>If I know the database-name and table-name, how can I find columns-count of the table from sql server master database?</p>
  
  <p>What is the fastest way to find the columns count of any database-table?</p>
  
  <p>What do you think about the performance of this query?</p>
  
  <pre><code>select count(*) from SYSCOLUMNS where id=(select id from SYSOBJECTS where name='Categories')
  </code></pre>
  
  <p>I need to support sql server 2000 and onwards.</p>