Find the number of columns in a table
Though its a rare situation when we need to know the number of columns in a table. You can get the number of columns information for a particular table by running the following query on SQL Server
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_catalog = 'Your_Database_Name'
AND table_name = 'Your_Table_Name'
Good luck!
SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_catalog = 'Your_Database_Name'
AND table_name = 'Your_Table_Name'
Good luck!
Comments
Post a Comment