Tags

, , ,

SELECT COUNT(COLUMN_NAME) 
FROM [ this_is_my_database_name].INFORMATION_SCHEMA.COLUMNS 
WHERE TABLE_CATALOG = ' this_is_my_database_name' 
AND TABLE_SCHEMA = 'dbo' --this is dbo by default, change if you need
AND TABLE_NAME = 'this_is_my_table_name'
Advertisements