SQL Server Performance

Nnumbar of coulmns

Discussion in 'Getting Started' started by Neelam, May 21, 2007.

  1. Neelam New Member

    Is there any way to extract number of coulmns in a table
  2. dineshasanka Moderator

    Select count(SC.Name) from syscolumns SC inner join sysobjects SO on SC.Id = SO.Id
    where SO.name = 'TableName'


    ----------------------------------------
    Contributing Editor, Writer & Forums Moderator
    http://www.SQL-Server-Performance.Com

    Visit my Blog at
    http://dineshasanka.spaces.live.com/
  3. Madhivanan Moderator

    Also
    Select count(*) from information_schema.columns
    where table_name='table name'

    Madhivanan

    Failing to plan is Planning to fail

Share This Page