In working with DQS, I realized that a couple of the features in Domain Management are not very intuitive and also slightly under-documented. So, here is a quick description of two features that I hope will be helpful.

First, you can use both the Domain Rules and Domain Values tab within one domain. Also, you can set your rule to include acceptable values. What is the difference?

Figure 1. The logical rule is set with specific value exceptions.

Well, when you get into it, you'll find that you can't specify values in the Domain Values tab as "Valid" if they don't comply with the rules. Therefore, if you want to allow exceptions to a logical rule, you have to create an extra condition (using "OR") and specify "Value is in." The difference between a rule using "Value is in" and the values in the Domain Values tab is the record status after the value is checked against the domain. When a checked value is included in the Domain Values tab, the record status is "Correct." When the value is in a "Value is in" condition but not in the Domain Values, it is marked as "New."

Second, I realized that it is a bit under-documented and somewhat difficult to grasp the difference between multiple rules in a domain and multiple conditions within one rule. See an example below. The rule "Complex Email Rule" within "MyDomain" has multiple conditions. This is in contrast to the domain itself, which has multiple rules ("Complex Email Rule" and "Internal Email").

Figure 2. This Domain has two logical rules. One has multiple conditions.

Here is how it works: If there are multiple rules, they act as "And." (Keep in mind that multiple conditions in one rule can be "Or" or "And.") If a value fails any one rule in the domain, it comes out of the DQS process with a Record Status of "Invalid." The rationale for implementing multiple rules rather than multiple conditions is that you can harvest the "reason." This "reason" tells you which of the rules failed and can be used to set flags or create descriptions that are useful in data stewardship tasks. Another thing to keep in mind is that neither SSIS nor Data Quality Projects allow you to check a single field against more than one domain, so all of the checks you want to run against a field need to live in one domain either as separate rules or as conditions in a rule.

I hope these little tidbits help out in your journey with DQS!