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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Editing Table Properties and Objects That Belong to the Table<br />

Beyond the basic attributes that we’ve looked at thus far, we can also edit many other facets of our table.<br />

How to get at these to edit or add to them happens in two different ways:<br />

❑ Properties: These are edited in a window that pops up and docks, by default, on the right-hand<br />

side of the Management Studio inside the diagramming window. To bring up the properties<br />

window, click the Properties Window icon on the toolbar in the Management Studio.<br />

❑ Objects that belong to the table, such as Indexes, Constraints, and Relationships: These are<br />

edited in their own dialog, which you can access by right-clicking on the table in the diagram<br />

and choosing the item that you want to set.<br />

These are important facets of our diagram-based editing, so let’s look at some of the major players.<br />

Properties Window<br />

242<br />

Making things like column order changes happens to be one area where the built-in<br />

tools positively excel. I’ve used a couple of other ERD tools, and they all offered the<br />

promise of synchronizing a change in column order between the database and the<br />

diagram — the success has been pretty hit and miss. (In other words, be very careful<br />

about doing it around live data.)<br />

Also, under the heading of one more thing — use the scripting option rather than the<br />

live connection to the database to make changes like this if you’re operating against live<br />

data. That way you can fully test the script against test databases before risking your<br />

real data. Be sure to also fully back up your database before making this kind of change.<br />

Figure 8-14 shows the Properties window for our CustomerNotes table.<br />

Figure 8-14<br />

You can use this properties window to set several key table properties — most notably what schema the<br />

table belongs to as well as whether the table has an Identity column.

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

Saved successfully!

Ooh no, something went wrong!