2009-09-25 テーブル名からカラム数を得る Microsoft SQL Server select count(*) from sys.columns where object_id = object_id(@tablename) 参照: http://oshiete1.goo.ne.jp/qa4455485.html