Need help designing a database 2

Posted on 2005-04-19
Last Modified: 2010-03-19
I asked a question similar to this before about designing a database for my WebApp.
This is how it is now.
Two tables

1.  Classes
   class_name  (Primary Key)

2.  Info
   info_id   (Primary Key)  (This is set to Data Type of Int and as an Identifier)
   class_name   (Foreign Key to class_name in Classes table)
The problem is that I can't change the name of class_name.  

Classes can have many info_dates and notes
One Class can only have one professor, time_start, time_end, days and room.

I want to be able to change the class name.  
Not sure how to design it so I can do this.  I tried to add another column to Classes called class_id and it the PK.  Then I tried to make class_id from Classes be the foreign key to class_id from Info.  MS SQL didn't like this.
Not sure what to do.
Question by:jettman26
    LVL 28

    Accepted Solution

    In Enterprise Manager, when you define the foreign key relationship, check on the "Cascade Update Related Fields" at the bottom of the screen.  Once done, you can now change the class_name and all fields on related tables will also be updated.

    Author Comment

    That was nice and simple.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Via a live example, show how to shrink a transaction log file down to a reasonable size.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    737 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

    20 Experts available now in Live!

    Get 1:1 Help Now