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 (https://blog.sqlauthority.com)

SQL Constraint and Keys, SQL Scripts, SQL Stored Procedure
Previous Post
SQLAuthority News – Write for SQLAuthority
Next Post
SQL SERVER 2005 – Vista Ultimate and SQL Server 2005 DEV Edition

Related Posts

2 Comments. Leave new

  • Chris Miller
    May 23, 2008 6:43 am

    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

    June 3, 2008 4:46 pm

    i want to rename
    existing data base in sql 2000 server. how i can do it


Leave a ReplyCancel reply

Exit mobile version