Home
%3CLINGO-SUB%20id%3D%22lingo-sub-388203%22%20slang%3D%22en-US%22%3EConfiguring%20SSIS%20DQS%20Domain%20Value%20Import%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-388203%22%20slang%3D%22en-US%22%3E%0A%20%26lt%3Bmeta%20http-equiv%3D%22Content-Type%22%20content%3D%22text%2Fhtml%3B%20charset%3DUTF-8%22%20%2F%26gt%3B%3CSTRONG%3E%20First%20published%20on%20MSDN%20on%20Aug%2005%2C%202013%20%3C%2FSTRONG%3E%20%3CBR%20%2F%3E%3CP%3EIn%20the%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F08%2F03%2Fautomating-dqs-domain-value-import.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20previous%20blog%20article%20%3C%2FA%3E%20%2C%20I%20described%20how%20to%20use%20the%20free%20%3CA%20href%3D%22https%3A%2F%2Fdomainvalueimport.codeplex.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20SSIS%20DQS%20Domain%20Value%20Import%20%3C%2FA%3E%20from%20%3CA%20href%3D%22http%3A%2F%2Fdata.oh22.net%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20OH22%20data%20%3C%2FA%3E%20to%20automate%20importing%20values%20into%20a%20DQS%20Knowledge%20Base%20domain.%20In%20this%20article%2C%20I%20will%20go%20over%20the%20optional%20configuration%20to%26nbsp%3Bimport%20invalid%2Ferror%20value%20types%20as%20well%20as%20to%20set%20synonyms.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EFirst%2C%20let's%20quickly%20recap%20the%20domain%20type%20and%20synonym.%3C%2FP%3E%3CBR%20%2F%3E%20Domain%20type%20%3CBR%20%2F%3E%3CP%3EIn%20DQS%2C%20you%20can%20define%20a%20domain%20value%20with%20different%20types%3A%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E%3CSTRONG%3ECorrect%20%3C%2FSTRONG%3E%20%3A%20This%20is%20a%20valid%20value%26nbsp%3Bthat%20belongs%20to%20the%20domain.%20For%20example%2C%20in%20the%20color%20name%20domain%2C%20red%20is%20a%20valid%20color%20name.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CSTRONG%3EError%20%3C%2FSTRONG%3E%20%3A%20This%20is%20a%20value%20that%20is%20incorrect.%20For%20example%2C%20'tbd'%20is%20not%20a%20correct%20color%20name.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E%3CSTRONG%3EInvalid%20%3C%2FSTRONG%3E%20%3A%20This%20is%20a%20value%20that%20may%20be%20correct%20but%20does%20not%20belong%20to%20the%20domain.%20For%20example%3A%20oliver%20is%20a%20correct%20person%20name%26nbsp%3Bbut%20it%20is%20not%20a%20correct%20color%20name.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3E%3CEM%3ENote%20%3C%2FEM%3E%20%3A%20The%20difference%20between%20%3CSTRONG%3E%20Error%20%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20is%20often%20subtle.%20Whether%20you%20set%20a%20domain%20value%26nbsp%3Bas%20%3CSTRONG%3E%20Error%20%3C%2FSTRONG%3E%20or%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20%2C%20DQS%20cleansing%20gives%20the%20same%20result%26nbsp%3Band%20marks%20records%26nbsp%3Bcontaining%20those%20values%20as%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20.%26nbsp%3B%20Many%20DQS%20implementation%20combine%20the%20%3CSTRONG%3E%20Error%20%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20and%20only%20use%20%3CSTRONG%3E%20Correct%20%3C%2FSTRONG%3E%20or%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20type%20to%20simplify.%3C%2FP%3E%3CBR%20%2F%3E%20Synonym%20%3CBR%20%2F%3E%3CP%3EWhen%20setting%20up%20domain%20value%20type%26nbsp%3Bto%20%3CSTRONG%3E%20Error%20%3C%2FSTRONG%3E%20or%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20%2C%20you%20can%20specify%20%3CSTRONG%3E%20Correct%20To%20%3C%2FSTRONG%3E%20value.%20DQS%20cleansing%20then%20automatically%20replace%20the%20value%20with%20the%20%3CSTRONG%3E%20Correct%20To%20%3C%2FSTRONG%3E%20(i.e.%20synonym).%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20%3CA%20href%3D%22https%3A%2F%2Fdomainvalueimport.codeplex.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20SSIS%20DQS%20Domain%20Value%20Import%20%3C%2FA%3E%20can%20automate%20importing%20values%20with%20different%20types%20and%20setting%20up%20synonym%20above.%26nbsp%3B%20To%20illustrate%2C%20I%20use%20the%20Knowledge%20Base%20from%20the%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F08%2F03%2Fautomating-dqs-domain-value-import.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20previous%20article%20%3C%2FA%3E%20%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99861iBE69A914FDA81E77%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-1680838722%22%20id%3D%22toc-hId-1761936550%22%3EImporting%20domain%20values%20with%20different%20types%3C%2FH2%3E%3CBR%20%2F%3E%3CP%3EConsider%20that%20we%20would%20like%20to%20insert%20new%20values%20to%20the%20domain%20%3CSTRONG%3E%20Name%20%3C%2FSTRONG%3E%20from%20a%20SQL%20table%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECREATE%20TABLE%20DQSCOLORS2%20(%20%3CBR%20%2F%3E%20NAME%20NVARCHAR(64)%2C%20%3CBR%20%2F%3E%20DomainType%20INT%20%3CBR%20%2F%3E%20)%20%3CBR%20%2F%3E%20--%20Note%3A%20that%20the%20column%20containing%20domain%20value%20must%20have%20NVARCHAR%2FNCHAR%20and%20Domain%20type%20must%20be%20set%20to%20INT%20data%20type.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EINSERT%20INTO%20DQSCOLORS2%20%3CBR%20%2F%3E%20VALUES%20%3CBR%20%2F%3E%20('white'%2C%200)%20%3CBR%20%2F%3E%20%2C('tbd'%2C%201)%20%3CBR%20%2F%3E%20%2C('oliver'%2C2)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20domain%20type%20column%20must%20be%20set%20to%20one%20of%20the%20following%20integer%20value%3A%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3E0%20(correct)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E1%20(error)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3E2%20(invalid)%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3EIn%20this%20example%2C%20'white'%20is%20a%20correct%20color%20name%2C%20'tbd'%20is%20an%20error%2C%20and%20'oliver'%20is%20an%20invalid%20color%20name.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EConfigure%20the%20%3CA%20href%3D%22https%3A%2F%2Fdomainvalueimport.codeplex.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20SSIS%20DQS%20Domain%20Value%20Import%20%3C%2FA%3E%20as%20follows%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99862i9AE9889EB6A5C5EC%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3ESpecify%20connection%20to%20the%20DQS%20server%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESelect%20the%20%3CSTRONG%3E%20Data%20Quality%20Knowledge%20Base%20%3C%2FSTRONG%3E%20from%20the%20drop%20down%20(e.g.%20%3CEM%3E%20Colors%20%3C%2FEM%3E%20).%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESelect%20the%20%3CSTRONG%3E%20Domain%20%3C%2FSTRONG%3E%20from%20the%20drop%20down%20(e.g.%20%3CEM%3E%20Name%20%3C%2FEM%3E%20)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESpecify%20input%20column%20for%20the%20Leading%20Value%20(e.g.%20Name)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3ESpecify%20input%20column%20for%20the%20type%20(e.g.%20DomainType).%20%3CSTRONG%3ENote%20%3C%2FSTRONG%3E%20%3A%20The%20drop%20down%20only%20shows%20column%20with%20INT%20data%20type.%20Check%20the%20data%20type%20if%20you%20do%20not%20see%20the%20column%20name%20from%20the%20drop%20down.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EAccept%20all%20other%20default%20setting%20(In%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F08%2F03%2Fhandling-error-in-ssis-dqs-domain-value-import.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20part%203%20%3C%2FA%3E%20of%20this%20series%2C%20I%20will%20explain%20how%20to%20use%20error%20handling%20options)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EClick%20OK%20to%20finish%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3EMake%20sure%20the%20DQS%20Knowledge%20Base%20%3CSTRONG%3E%20Colors%20%3C%2FSTRONG%3E%20is%20published%20before%20executing%20the%20SSIS%20package.%20After%20the%20SSIS%20package%20completed%2C%20open%20the%20Knowledge%20Base%20%26nbsp%3Bto%20review%20the%20result%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99863iCB9D3148CC10A13E%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20domain%20values%20are%20added%20with%20the%20specified%20type.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EA%26nbsp%3Bcouple%20of%26nbsp%3Bthings%20to%20consider%20when%20using%20the%20Domain%20Type%20option%3A%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EDomain%20type%20source%20column%20must%20be%20set%20to%20INT%20and%20contained%20only%200%2C1%2C2%26nbsp%3Band%26nbsp%3Bdoes%20not%20have%20NULL%20--%20any%20violation%20to%20this%20will%20result%20in%20error%20during%20package%20execution.%20%26nbsp%3BSee%20the%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F08%2F03%2Fhandling-error-in-ssis-dqs-domain-value-import.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20next%20article%20%3C%2FA%3E%20for%20more%20information%20on%20error%20handling.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20can't%20update%20an%20existing%20domain%20type%20(e.g.%20you%20want%20to%20change%20green%20from%20%3CSTRONG%3E%20Correct%20%3C%2FSTRONG%3E%20to%20I%20%3CSTRONG%3E%20nvalid%20%3C%2FSTRONG%3E%20).%20This%20must%20be%20done%20through%20DQS%20Client.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId--871318239%22%20id%3D%22toc-hId--790220411%22%3EImporting%20domain%20values%20with%20synonym%3C%2FH2%3E%3CBR%20%2F%3E%3CP%3EIn%20this%20example%2C%20I%20set%20up%20a%20new%20table%20with%20the%20following%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%20CREATE%20TABLE%20DQSCOLORS3%20(%20%3CBR%20%2F%3E%20NAME%20NVARCHAR(64)%2C%20%3CBR%20%2F%3E%20Synonym%26nbsp%3B%20NVARCHAR(64)%20%3CBR%20%2F%3E%20)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EINSERT%20INTO%20DQSCOLORS3%20VALUES%20%3CBR%20%2F%3E%20('white'%2C%20'bright%20white')%20%3CBR%20%2F%3E%20%2C('DQS_NULL'%2C%20'not%20specified')%20%3CBR%20%2F%3E%20%2C('clear'%2C%20'transparent')%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20first%20row%20sets%20synonym%20to%20an%20existing%20valid%20value%20(e.g.%20'white')%20in%20the%20domain.%20The%20second%20row%20sets%20synonym%20to%20a%20special%20domain%20value%20called%20%3CEM%3E%20DQS_NULL%20%3C%2FEM%3E%20(this%20value%20can%20be%20used%20to%20specify%20how%20to%20handle%20NULL%20during%20DQS%20cleansing).%26nbsp%3B%20The%20last%20row%20set%20synonym%20where%20both%20the%20leading%20value%20and%20its%20synonym%20are%20not%20currently%20in%20the%20domain.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EConfigure%20the%26nbsp%3B%20SSIS%20DQS%20Domain%20Value%20Import%20as%20follows%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99864i0FEF9BD56294E297%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EMake%20sure%20the%20DQS%20Knowledge%20Base%20%3CSTRONG%3E%20Colors%20%3C%2FSTRONG%3E%20is%20published%2C%20then%20execute%20the%20SSIS%20package%20and%20review%20the%20result%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99865i77111571F129BF1F%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20synonyms%20are%20successfully%20added%20to%20the%20DQS%20domain.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E'bright%20white'%20and%20'not%20specified'%20are%20set%20as%20%3CSTRONG%3E%20Correct%20to%20%3C%2FSTRONG%3E%20'white'%20and%20DQS_NULL%20accordingly.%20This%20means%2C%20for%20example%2C%20that%20when%20you%20are%20cleansing%20records%20containing%20'not%20specified'%2C%20it%20will%20be%20corrected%20to%20null.%20Lastly%2C%20both%20'clear'%20and%20'transparent'%20are%20added%20with%20'clear'%20set%20as%20the%20leading%20value.%20Note%20that%20when%20importing%20leading%20value%20and%20synonyms%20using%20SSIS%20DQS%20Domain%20Value%20Import%2C%20the%20synonyms%20are%20always%20set%20to%20invalid%20type%20(e.g.%20'transparent')%20while%20the%20leading%20value%20are%20always%20set%20to%20correct%20(e.g.%20'clear').%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EA%26nbsp%3Bfew%26nbsp%3Bthings%20to%20consider%20when%20using%20the%20%3CSTRONG%3E%20Synonym%20%3C%2FSTRONG%3E%20option%3A%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3ESynonyms%20are%20created%20as%20new%20value%20with%20domain%20type%20always%20set%20to%20%3CSTRONG%3E%20Invalid%3C%2FSTRONG%3E%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20can%20set%20synonym%20to%20an%20existing%20%3CSTRONG%3E%20Correct%20%3C%2FSTRONG%3E%20domain%20values%20(e.g.%20'white%22%20and%20'DQS_NULL')%20--%20If%20you%20try%20to%20set%20synonym%20to%20an%20%3CSTRONG%3E%20Invalid%20%3C%2FSTRONG%3E%20%2F%20%3CSTRONG%3E%20Error%20%3C%2FSTRONG%3E%20domain%2C%20you%20will%20get%20an%20error%20during%20package%20execution.%20See%20the%20next%20article%20for%20more%20information%20on%20error%20handling.%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EYou%20can%20set%20synonym%20to%20BOTH%20a%20new%20domain%20value%20and%20a%20new%20synonym%20pair%20(e.g.%20'clear'%20and%20'transparent'%20are%20new%20and%20not%20previously%20exists%20in%20the%20%3CEM%3E%20Color%20Name%20%3C%2FEM%3E%20domain)%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CH2%20id%3D%22toc-hId-871492096%22%20id%3D%22toc-hId-952589924%22%3EImporting%20domain%20values%20with%20both%20different%20types%20and%20synonym%3C%2FH2%3E%3CBR%20%2F%3E%3CP%3EIn%20this%20last%20example%2C%20we%20will%20import%20data%20that%20include%20both%20type%20and%20synonym%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ECREATE%20TABLE%20DQSCOLORS4%20(%20%3CBR%20%2F%3E%20NAME%20NVARCHAR(64)%2C%20%3CBR%20%2F%3E%20DomainType%20INT%2C%20%3CBR%20%2F%3E%20Synonym%26nbsp%3B%20NVARCHAR(64)%20%3CBR%20%2F%3E%20)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EINSERT%20INTO%20DQSCOLORS4%20%3CBR%20%2F%3E%20VALUES%20%3CBR%20%2F%3E%20('red'%2CNULL%26nbsp%3B%2C'dark%20red')%20%3CBR%20%2F%3E%20%2C('blue'%2C0%26nbsp%3B%2C'dark%20blue')%20%3CBR%20%2F%3E%20%2C('blue'%2C1%26nbsp%3B%2C'light%20blue')%20%3CBR%20%2F%3E%20%2C('blue'%2C3%26nbsp%3B%2C'bright%20blue')%20%3CBR%20%2F%3E%20%2C('yellow'%2C0%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%2C%20NULL)%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdomainvalueimport.codeplex.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDQS%20Domain%20Value%20import%20%3C%2FA%3E%20is%20configured%20to%20map%20all%20three%20input%20columns%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99866iC826CCDAB568C9E5%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EThe%20result%20of%20the%20SSIS%20package%20execution%20shows%20the%20following%3A%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F99867i483E66EE1603C7CD%22%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3EA%26nbsp%3Bfew%26nbsp%3Bthings%20to%20consider%20when%20using%20both%20%3CSTRONG%3E%20Domain%20Type%20%3C%2FSTRONG%3E%20and%20%3CSTRONG%3E%20Synonym%20%3C%2FSTRONG%3E%20option%3A%3C%2FP%3E%3CBR%20%2F%3E%3CUL%3E%3CBR%20%2F%3E%3CLI%3EDomain%20type%20is%20ignored%20when%20you%20have%20synonym.%20The%20new%20synonym%20always%20have%20Invalid%20type.%20(e.g.%20see%20'dark%20red'%2C%20'dark%20blue'%2C%20'light%20blue'%20examples%20above)%3C%2FLI%3E%3CBR%20%2F%3E%3CLI%3EWhen%20the%20synonym%20is%20NULL%2C%20then%20the%20Domain%20Type%20must%20have%20non%20NULL%20valid%20of%20either%200%2C1%2C2.%20In%20another%20word%2C%20you%20can't%20have%20both%20domain%20type%20and%20synonym%20to%20be%20NULL.%20This%20will%20result%20in%20an%20error%20during%20package%20execution.%3C%2FLI%3E%3CBR%20%2F%3E%3C%2FUL%3E%3CBR%20%2F%3E%3CP%3ELet's%20proceed%20to%20the%20%3CA%20href%3D%22http%3A%2F%2Fblogs.msdn.com%2Fb%2Fdqs%2Farchive%2F2013%2F08%2F03%2Fhandling-error-in-ssis-dqs-domain-value-import.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3E%20next%20article%20%3C%2FA%3E%20where%20I%20describe%26nbsp%3Bthe%20options%20you%20can%20use%20to%20handle%20error%20during%20import.%3C%2FP%3E%0A%20%0A%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-388203%22%20slang%3D%22en-US%22%3EFirst%20published%20on%20MSDN%20on%20Aug%2005%2C%202013%20In%20the%20previous%20blog%20article%2C%20I%20described%20how%20to%20use%20the%20free%20SSIS%20DQS%20Domain%20Value%20Import%20from%20OH22%20data%26nbsp%3Bto%20automate%20importing%20values%20into%20a%20DQS%20Knowledge%20Base%20domain.%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-388203%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3E2012%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Ecleansing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20cleansing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20quality%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20quality%20service%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edata%20quality%20services%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%20cleansing%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%20cleansing%20component%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Edqs%20ssis%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Elearning%20resources%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESQL%20Server%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esql%20server%202012%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Esqlserver%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3Essis%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Regular Visitor
First published on MSDN on Aug 05, 2013

In the previous blog article , I described how to use the free SSIS DQS Domain Value Import from OH22 data to automate importing values into a DQS Knowledge Base domain. In this article, I will go over the optional configuration to import invalid/error value types as well as to set synonyms.


First, let's quickly recap the domain type and synonym.


Domain type

In DQS, you can define a domain value with different types:



  • Correct : This is a valid value that belongs to the domain. For example, in the color name domain, red is a valid color name.

  • Error : This is a value that is incorrect. For example, 'tbd' is not a correct color name.

  • Invalid : This is a value that may be correct but does not belong to the domain. For example: oliver is a correct person name but it is not a correct color name.


Note : The difference between Error and Invalid is often subtle. Whether you set a domain value as Error or Invalid , DQS cleansing gives the same result and marks records containing those values as Invalid .  Many DQS implementation combine the Error and Invalid and only use Correct or Invalid type to simplify.


Synonym

When setting up domain value type to Error or Invalid , you can specify Correct To value. DQS cleansing then automatically replace the value with the Correct To (i.e. synonym).


The SSIS DQS Domain Value Import can automate importing values with different types and setting up synonym above.  To illustrate, I use the Knowledge Base from the previous article :



Importing domain values with different types


Consider that we would like to insert new values to the domain Name from a SQL table:


CREATE TABLE DQSCOLORS2 (
NAME NVARCHAR(64),
DomainType INT
)
-- Note: that the column containing domain value must have NVARCHAR/NCHAR and Domain type must be set to INT data type.


INSERT INTO DQSCOLORS2
VALUES
('white', 0)
,('tbd', 1)
,('oliver',2)


The domain type column must be set to one of the following integer value:



  • 0 (correct)

  • 1 (error)

  • 2 (invalid)


In this example, 'white' is a correct color name, 'tbd' is an error, and 'oliver' is an invalid color name.


Configure the SSIS DQS Domain Value Import as follows:




  • Specify connection to the DQS server

  • Select the Data Quality Knowledge Base from the drop down (e.g. Colors ).

  • Select the Domain from the drop down (e.g. Name )

  • Specify input column for the Leading Value (e.g. Name)

  • Specify input column for the type (e.g. DomainType). Note : The drop down only shows column with INT data type. Check the data type if you do not see the column name from the drop down.

  • Accept all other default setting (In part 3 of this series, I will explain how to use error handling options)

  • Click OK to finish


Make sure the DQS Knowledge Base Colors is published before executing the SSIS package. After the SSIS package completed, open the Knowledge Base  to review the result:



The domain values are added with the specified type.


A couple of things to consider when using the Domain Type option:



  • Domain type source column must be set to INT and contained only 0,1,2 and does not have NULL -- any violation to this will result in error during package execution.  See the next article for more information on error handling.

  • You can't update an existing domain type (e.g. you want to change green from Correct to I nvalid ). This must be done through DQS Client.


Importing domain values with synonym


In this example, I set up a new table with the following:



CREATE TABLE DQSCOLORS3 (
NAME NVARCHAR(64),
Synonym  NVARCHAR(64)
)


INSERT INTO DQSCOLORS3 VALUES
('white', 'bright white')
,('DQS_NULL', 'not specified')
,('clear', 'transparent')


The first row sets synonym to an existing valid value (e.g. 'white') in the domain. The second row sets synonym to a special domain value called DQS_NULL (this value can be used to specify how to handle NULL during DQS cleansing).  The last row set synonym where both the leading value and its synonym are not currently in the domain.


Configure the  SSIS DQS Domain Value Import as follows:



Make sure the DQS Knowledge Base Colors is published, then execute the SSIS package and review the result:



The synonyms are successfully added to the DQS domain.


'bright white' and 'not specified' are set as Correct to 'white' and DQS_NULL accordingly. This means, for example, that when you are cleansing records containing 'not specified', it will be corrected to null. Lastly, both 'clear' and 'transparent' are added with 'clear' set as the leading value. Note that when importing leading value and synonyms using SSIS DQS Domain Value Import, the synonyms are always set to invalid type (e.g. 'transparent') while the leading value are always set to correct (e.g. 'clear').


A few things to consider when using the Synonym option:



  • Synonyms are created as new value with domain type always set to Invalid

  • You can set synonym to an existing Correct domain values (e.g. 'white" and 'DQS_NULL') -- If you try to set synonym to an Invalid / Error domain, you will get an error during package execution. See the next article for more information on error handling.

  • You can set synonym to BOTH a new domain value and a new synonym pair (e.g. 'clear' and 'transparent' are new and not previously exists in the Color Name domain)


Importing domain values with both different types and synonym


In this last example, we will import data that include both type and synonym:


CREATE TABLE DQSCOLORS4 (
NAME NVARCHAR(64),
DomainType INT,
Synonym  NVARCHAR(64)
)


INSERT INTO DQSCOLORS4
VALUES
('red',NULL ,'dark red')
,('blue',0 ,'dark blue')
,('blue',1 ,'light blue')
,('blue',3 ,'bright blue')
,('yellow',0         , NULL)


DQS Domain Value import is configured to map all three input columns:



The result of the SSIS package execution shows the following:



A few things to consider when using both Domain Type and Synonym option:



  • Domain type is ignored when you have synonym. The new synonym always have Invalid type. (e.g. see 'dark red', 'dark blue', 'light blue' examples above)

  • When the synonym is NULL, then the Domain Type must have non NULL valid of either 0,1,2. In another word, you can't have both domain type and synonym to be NULL. This will result in an error during package execution.


Let's proceed to the next article where I describe the options you can use to handle error during import.