google

Newest Post

Find the number of columns in a Table in MS-SQL

| Thursday, March 12, 2020
Read more »
Following script can be used to find the number of columns in a table.


SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS 
WHERE table_catalog = 'name_of_database' -- the database
   AND table_name = 'name_of_table'


e.g 
Use Hospital
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS 
WHERE table_catalog = 'Hospital' -- the database   AND table_name = 'User'

Find the number of columns in a Table in MS-SQL

Posted by : Pooja
Date :Thursday, March 12, 2020
With 0comments
Next Prev
▲Top▲