Declare @TableName as nvarchar(50) Set @TableName = 'AccessServerLog' /* extendedpropertyに予め値を入れておくと管理がしやすい MS_Description = カラム名の説明 DataSours = データの取得元の説明 Description = カラムに関連する備考を入れておく(0:無効/1:有効など) */ select A.Name as TableName, B.colid as ColmunID, B.Name as ColmunName, D.value as MS_Description, D1.value as DataSours, D2.value as Description, C.Name as DataType, B.length, B.xprec, B.xscale, A.crdate from sys.sysobjects A inner join sys.syscolumns B on A.id = B.id left join sys.types C on B.xtype=C.system_type_id and B.xusertype=C.user_type_id left join (Select * From sys.extended_properties where Name='MS_Description') D on D.major_id = B.id AND D.minor_id = B.colid left join (Select * From sys.extended_properties where Name='DataSours') D1 on D1.major_id = B.id AND D1.minor_id = B.colid left join (Select * From sys.extended_properties where Name='Description') D2 on D2.major_id = B.id AND D2.minor_id = B.colid where A.xtype='U' --and A.Name =@TableName order by A.Name,B.colid