MS_Description


カラム説明付与。

EXEC sys.sp_addextendedproperty 
	@name=N'MS_Description', 
	@value=N'設定する値' , 
	@level0type=N'SCHEMA',
	@level0name=N'すきーまめい', 
	@level1type=N'TABLE',
	@level1name=N'てーぶるめい', 
	@level2type=N'COLUMN',
	@level2name=N'からむめい'
GO
SELECT
  t.name    AS table_name
  ,c.name    AS column_name
  ,ep.name   AS pname
  ,ep.value  AS commnet
FROM
 sys.tables AS t
LEFT OUTER JOIN
 sys.columns AS c
ON
 t.object_id = c.object_id 
LEFT OUTER JOIN
 sys.extended_properties AS ep
ON
 c.object_id = ep.major_id AND
 c.column_id = ep.minor_id
WHERE
  t.name = 'てーぶるめい'
カテゴリー: 運用, 開発 タグ: パーマリンク