[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Change relationship names in MS SQL 2000

I have changed table names in an sql 2000 database and I discovered that realationship names still contain old table names when I run query on system table sysobjects.  Can I change relationship names through sysobjects table or it is risky? Is there a stored procedure that can be run to replace part of the name (i.e the one representing name of table) in a relationship through sysobjects? For e.g relationship name FK_dbDocuments_dbUsers should be FK_dbDocs_dbUsers.


1 Solution
Scott PletcherSenior DBACommented:
You should be able to rename FKs using:

EXEC sp_rename 'oldName', 'newName', 'OBJECT'

See Books Online for more details.

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now