Contents

1
2 企 覃一危
3 貉殊 覃一危
4 レ 譟壱
5 谿瑚 襷 襭


1 #

MetaData! 願碓 螻豺 . MS Office覓語 蠍壱 襦語, ろ 煙朱 襷れ 覓語 碁螳 蟇一 . 覃 豕煙 覲伎ロ 蠍 覓語企. 襷 覲蟆曙 覈磯 螻, 蟯襴 る 襷 碁 蟆企. 讌襷 れ 譯殊 蟆 れ企. 碁レ朱 蟯襴蠍磯 曙螳 . 讌企朱 覈襯手 . 伎 蟯襴螳 る DB 伎 . DB DBMS ル伎 る 詞企.

Microsoft SQL Server 企ゼ 企至 蟯襴蟾? MetaData襯 一危 覈語 襷り 螳 覲伎朱, 伎 一煙 伎. 一煙 蟆 り覃 讌 蟆螻 讌襷, 襷 螳 蟆 れ企. 覦覃伎朱 覦 谿場覲伎. 蟆磯 ' ' 伎 蟆企. 煙 譯 壱蠍 覓語 MetaData襦 . MetaData Tool 襷れ企 .

譴 蟆 讌誤 覓語(.docx, .hwp, .xlsx, .pptx ) 蟯襴蠍 るる 蟆企. 覈 螳覦/覲蟆曙 覓語襯 伎 覃, 覓語螳 蠍 蟾讌 覓企 覈詩り る 覈襯手 螳 讌覃 蟯襴讌 蟆 れ企. 麹 覓語朱 蟆 轟 襷豢伎 , 願 覓語 覦螳 蠍磯 . 蠏碁覩襦 讌朱 Metadata襯 蟯襴蠍 伎 Metadata 一危磯伎 蟯襴 ろ 覲願螻 蟯襴伎 .

2 企 覃一危 #

SELECT 
	'EXEC sys.sp_addextendedproperty ' + 
	CASE 
		WHEN B.Seq = 1 THEN 'N''1. Source IP'', '''', '
		WHEN B.Seq = 2 THEN 'N''2. Source DB'', '''', '
		WHEN B.Seq = 3 THEN 'N''3. Source Schema'', '''', '
		WHEN B.Seq = 4 THEN 'N''4. Source Table'', '''', '
		WHEN B.Seq = 5 THEN 'N''5. ETL Rule'', '''', '
		WHEN B.Seq = 6 THEN 'N''6. Descriptions'', '''', '
	END + 
	'N''SCHEMA'', N''' + TABLE_SCHEMA + ''', ' + 
	'N''TABLE'', N''' + TABLE_NAME + ''''
from information_schema.tables
	CROSS JOIN (
		SELECT 1 Seq UNION ALL 
		SELECT 2 Seq UNION ALL 
		SELECT 3 Seq UNION ALL 
		SELECT 4 Seq UNION ALL 
		SELECT 5 Seq UNION ALL
		SELECT 6
		) B
WHERE TABLE_NAME = '企覈'

3 貉殊 覃一危 #

-- 企 貉殊 レ煙 伎. 
--  IP
--  DB
--  Schema
--  企
--  貉
-- ETL Rule
-- Value Rule

SELECT 
	'EXEC sys.sp_addextendedproperty ' + 
	CASE 
		WHEN B.Seq = 1 THEN 'N''1. Source IP'', '''', '
		WHEN B.Seq = 2 THEN 'N''2. Source DB'', '''', '
		WHEN B.Seq = 3 THEN 'N''3. Source Schema'', '''', '
		WHEN B.Seq = 4 THEN 'N''4. Source Table'', '''', '
		WHEN B.Seq = 5 THEN 'N''5. Source Column'', '''', '
		WHEN B.Seq = 6 THEN 'N''6. ETL Rule'', '''', '
		WHEN B.Seq = 7 THEN 'N''7. Value Rule'', '''', '
	END + 
	'N''SCHEMA'', N''' + TABLE_SCHEMA + ''', ' + 
	'N''TABLE'', N''' + TABLE_NAME + ''', ' +
	'N''COLUMN'', N''' + COLUMN_NAME + ''''
FROM INFORMATION_SCHEMA.COLUMNS
	CROSS JOIN (
		SELECT 1 Seq UNION ALL 
		SELECT 2 Seq UNION ALL 
		SELECT 3 Seq UNION ALL 
		SELECT 4 Seq UNION ALL 
		SELECT 5 Seq UNION ALL 
		SELECT 6 Seq UNION ALL
		SELECT 7) B
--WHERE TABLE_NAME = '企覈'

4 レ 譟壱 #

select distinct
    s.name as [schema]
,   t.name as [table name]
,   c.name as [column name]          
,   ep.name as [property name]
,   ep.value as [business definition]
from sys.tables as t
    inner join sys.schemas as s
        on s.schema_id = t.schema_id
    inner join sys.columns as c
        on t.object_id = c.object_id
    inner join sys.extended_properties as ep
        on ep.major_id = t.object_id
        and ep.minor_id=c.column_id
--where ep.name in ('1. Source IP')

5 谿瑚 襷 襭 #