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

I can then add in my new column, and reset the Primary Key as shown in Figure 8-13 (select both rows,<br />

right-click and choose Set Primary Key).<br />

Figure 8-13<br />

Now just save, and you have a table with the desired column order. Just to verify this, try using sp_help:<br />

EXEC sp_help CustomerNotes;<br />

You’ll see that we have the column order we expect:<br />

....<br />

CustomerID<br />

Sequence<br />

NoteDate<br />

EmployeeID<br />

Note<br />

....<br />

Depending on your specific option settings, you may run into an error here when you<br />

save the CustomerNotes table. At issue is a safety feature that is new with <strong>SQL</strong> <strong>Server</strong><br />

<strong>2008</strong>, and is meant to prevent you from accidentally overwriting tables while in the<br />

designer. If you get an error referencing an option called "Prevent saving changes that<br />

require table re-creation," you can find that in the Options dialog under the Tools<br />

menu — you'll need to navigate to the Designers Table and Database Designers<br />

item in this dialog, and then deselect the “Prevent saving changes that require table<br />

re-creation” option. Your table should then save without further difficulty.<br />

241

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

Saved successfully!

Ooh no, something went wrong!