https://social.msdn.microsoft.com/Forums/en-US/f73e50b1-c95d-4389-b637-47ef73505f10/how-to-count-columns-in-a-table?forum=transactsql
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COUNT(COLUMN_NAME ) ColCount
FROM INFORMATION_SCHEMA.COLUMNS
GROUP BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
ORDER BY TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME;
新版本:
http://it.rex.tw/2017/11/columns.html
沒有留言:
張貼留言