Contents

1 覓語! 覓語?
2 谿瑚


1 覓語! 覓語? #

螳 れ 覦覯 螻, Microsoft SQL Server ETL Meta Data 螻覩殊 り 螳企 蟆企. 朱 覓語覃 り骸 覿殊煙 蟆 蠍 讌 碁レ . 願 覲願鍵 語 覓語 讌覲伎螳 螳 企. 覓語 企 覓語襯 覓語 谿所 覦 覓語螳 蠍 殊る. 蠏碁 螳 覦覯 覦覯企. 語 DB企り骸 螳蟾 蟆 蠏碁 豕 り骸 殊煙 讌 豕螻 覦覯企 螳. 覦覯 螳. レ煙 伎 蟆企. 覓語螳 ETL Meta Data DB.

2 谿瑚 #

/*
企 貉殊 レ煙 伎. 

-  IP
-  DB
-  Schema
-  企
-  貉
- ETL Rule
*/
EXEC sys.sp_addextendedproperty 
	@name = N'IP'
,	@value = N'192.168.0.1' 
,	@level0type = N'SCHEMA'
,	@level0name = N'Common'
,	@level1type = N'TABLE'
,	@level1name = N'企覈'
,	@level2type = N'COLUMN'
,	@level2name = N'貉朱'
GO

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'', '''', '
	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) B
--WHERE TABLE_NAME = '企覈'