30.06.2013 Views

SQL Server Team-based Development - Red Gate Software

SQL Server Team-based Development - Red Gate Software

SQL Server Team-based Development - Red Gate Software

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.

Summary ................................................................................................................................196<br />

Chapter 7: Maintaining a Code Library .......................................198<br />

Coding for Reuse ..................................................................................................................199<br />

Code.comments............................................................................................................. 199<br />

Parameter.naming..........................................................................................................201<br />

Unit.tests......................................................................................................................... 203<br />

Storing Script Libraries ....................................................................................................... 204<br />

Source.control................................................................................................................ 205<br />

A.single.file.or.individual.files?..................................................................................... 205<br />

Tools for Creating and Managing Code Libraries .......................................................... 206<br />

<strong>SQL</strong>.<strong>Server</strong>.Management.Studio................................................................................. 207<br />

Text.editors...................................................................................................................... 213<br />

Wikis................................................................................................................................. 215<br />

<strong>SQL</strong>.Prompt.....................................................................................................................219<br />

Summary ................................................................................................................................224<br />

Chapter 8: Exploring your Database Schema ............................225<br />

Building a Snippet Library ..................................................................................................226<br />

Interrogating Information Schema and Catalog Views .................................................227<br />

Searching Structural Metadata in Schema-scoped Objects within a Database .........229<br />

Tables.with.no.primary.keys........................................................................................ 230<br />

Tables.with.no.referential.constraints......................................................................... 231<br />

Tables.with.no.indexes...................................................................................................232<br />

A.one-stop.view.of.your.table.structures.................................................................... 233<br />

How.many.of.each.object…...........................................................................................236<br />

Too.many.indexes…........................................................................................................237<br />

Seeking.out.troublesome.triggers................................................................................238<br />

What.objects.have.been.recently.modified?..............................................................240<br />

Querying.the.documentation.in.extended.properties............................................ 242<br />

Object.permissions.and.owners...................................................................................243<br />

Searching All Your Databases .............................................................................................245<br />

Investigating Foreign Key Relationships ......................................................................... 246<br />

Interrogating Object Dependencies .................................................................................. 251

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

Saved successfully!

Ooh no, something went wrong!