Solved

Change relationship names in MS SQL 2000

Posted on 2004-10-21
193 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
Question by:miamati
    1 Comment
     
    LVL 68

    Accepted Solution

    by:
    You should be able to rename FKs using:

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


    See Books Online for more details.
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    The Complete Ruby on Rails Developer Course

    Ruby on Rails is one of the most popular web development frameworks, and a useful tool used by both startups and more established companies to build strong graphic user interfaces, and responsive websites and apps.

    In this article—a derivative of my DaytaBase.org blog post (http://daytabase.org/2011/06/18/what-week-is-it/)—I will explore a few different perspectives on which week today's date falls within using Microsoft SQL Server. First, to frame this stu…
    Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Via a live example, show how to shrink a transaction log file down to a reasonable size.

    846 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

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now