table column count in sql server code example Example: get number of table colums in sql query select count(*) from tablename