Showing posts with label sql count columns. Show all posts
Showing posts with label sql count columns. Show all posts

Count Columns in a Table SQL


SELECT  count(*) from information_schema.columns where table_name='giveTableNameHere'
or
SELECT  count(*) FROM syscolumns WHERE   OBJECT_NAME(id) = 'giveTableNameHere'

here i given my tested query for counting columns in a particular Table in a DB