17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 8: Being Normal: Normalization and Other Basic Design Issues<br />

How It Works<br />

Much like when we added the table in the previous section, <strong>SQL</strong> <strong>Server</strong> is constructing <strong>SQL</strong> behind the<br />

scenes to make the changes you need. So far, it has added the relationship to the diagram only — if you<br />

hover over that relationship, you even see a tooltip with the relationship’s name and nature, as shown in<br />

Figure 8-21.<br />

Figure 8-21<br />

Notice the asterisk on both tables!!! The changes we have made have only been added to the change list<br />

that you’ve made to the diagram — they will not be added to the physical database until you choose to<br />

save the diagram!<br />

There is an instance where the way the line is displayed will change — when we “disable” the foreign<br />

key. We saw how to disable constraints in our last chapter, and we can do it in the Relationship dialog<br />

by changing the Enforce Foreign Key Constraint drop-down setting to No. When you do that, your line<br />

will change to let you know that the constraint has been disabled. It will now look something like<br />

Figure 8-22.<br />

Figure 8-22<br />

If you see one of these, you’re first question should be “Why is that disabled?” Maybe it was intentional,<br />

but you’ll want to be sure.<br />

De-Normalization<br />

I’m going to keep this relatively short since this tends to get into fairly advanced concepts, but remember<br />

not to get carried away with the normalization of your data.<br />

247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!