Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Change relationship names in MS SQL 2000

Posted on 2004-10-21
3
Medium Priority
?
249 Views
Last Modified: 2012-06-22
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.

tks
m

0
Comment
Question by:miamati
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 70

Accepted Solution

by:
Scott Pletcher earned 400 total points
ID: 12373407
You should be able to rename FKs using:

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


See Books Online for more details.
0

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question