SQL SERVER – How to Rename Database Objects to Comply With Naming Conventions

Christopher Miller read article of SQL SERVER Database Coding Standards and Guidelines Complete List Download and came up with wonderful SQL Server Script to rename all their database constraint with more organized constraint names, which helps to easily identify the constraint database exist on.

Christopher Miller – “When we submit our schema updates internally, we usually catch any deviation from our naming conventions.  It’s not a perfect process and every now and then, something slips through the cracks.  We then correct the schema update to use the appropriate naming convention.  if we have been using the schema changes internally, we may have some databases that don’t match the published schema for the object names.  When that happens, we run a simple T-SQL script that cleans house.  The following T-SQL will scan the database for default constraints that do not match our naming conventions and rename the ones that it finds.”

Read more about this subject and find the script to rename database objects How to rename database objects to comply with naming conventions.

Reference : Pinal Dave (http://blog.SQLAuthority.com)

2 thoughts on “SQL SERVER – How to Rename Database Objects to Comply With Naming Conventions

  1. Hi Pinal,

    Thanks for the link to my blog posting. I’ve been using various versions of that script since SQl Server 6.5 to help enforce coding standards, but it’s much easier with the current versions of SQL Server.

    -Chris Miller


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s