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 />

From here, you can, as I’m sure you can imagine, create, edit, and delete indexes. You can also establish<br />

which filegroup you want the index to be stored on (in most instances, you’ll just want to leave this<br />

alone). We’ll look further into indexes in our next chapter.<br />

Check Constraints<br />

Moving on to the next menu option (or icon if you’re using the toolbar to get to these dialogs that we’ll<br />

examine here), we can manage check constraints as shown in Figure 8-17.<br />

Again, this one is pretty much grayed out. Why? Well, there aren’t any constraints of any kind other<br />

than a primary key defined for our CustomerNotes table, and that primary key is dealt with on the<br />

Index/Keys tab. This particular dialog is for check constraints only — if you want to see this tab in full<br />

action, then you need to click Add and add a constraint.<br />

Relationships<br />

244<br />

Figure 8-17<br />

Well, we’ve seen what the diagramming tool offers us relative to tables, so, as promised, next up on our<br />

list to review is the relationship line (and the underlying details of that relationship).<br />

Looking at a relationship line, the side with the key is the side that is the “one” side of a relationship.<br />

The side that has the infinity symbol represents your “many” side. The tools have no relationship line<br />

available to specifically represent relationships where zero is possible (it still uses the same line). In<br />

addition, the only relationships that actually show in the diagram are ones that are declared using foreign<br />

key constraints. Any relationship that is enforced via triggers — regardless of the type of relationship —<br />

will not cause a relationship line to appear.<br />

Looking at our AdventureWorks<strong>2008</strong> diagram again, and try right-clicking the SalesOrderHeader<br />

table and selecting Relationships. This brings up a more populated version of the Relationship dialog

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

Saved successfully!

Ooh no, something went wrong!