Yet a third way to fix this

ALTER TABLE Employees ADD CASCADE
UPDATE Employees SET EmpID = <new> WHERE EmpID = <old>
ALTER TABLE Employees DROP CASCADE

HEADS UP;  Make sure that every occurence of EmpID is FKd to Employees


[EMAIL PROTECTED] wrote:

>I have an interesting issue -
>
>I have a table called 'employees' which has EMPID set as a primary key
>I have another table called 'qualified_master' which has EMPID as a foreign
>key that references 'employees'
>
>Well, since mistakes happen, an employee was entered with the wrong EMPID in
>both the 'employees' table, and also had entries entered into the
>'qualified_master' and 'qualified_details' tables.
>
>Because of the constraint, I cannot update the EMPID in either table! Is
>there a way to change it I am not seeing, short of deleting the rows in the
>'qualified_master' and 'qualified_detail' tables? That is my last resort
>because there is a lot of data in those tables tied to this particular
>employee.
>
>Thanks!
>Charles Sikora
>Coordinator, Gas Storage
>Manlove Field
>Peoples Energy Corporation 
>
>================================================
>TO SEE MESSAGE POSTING GUIDELINES:
>Send a plain text email to [EMAIL PROTECTED]
>In the message body, put just two words: INTRO rbase-l
>================================================
>TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
>In the message body, put just two words: UNSUBSCRIBE rbase-l
>================================================
>TO SEARCH ARCHIVES:
>http://www.mail-archive.com/rbase-l%40sonetmail.com/
>


-- 
Albert Berry
Full Time Consultant to
PSD Solutions
350 West Hubbard, Suite 210
Chicago, IL 60610
312-828-9253 Ext. 32


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
================================================
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: INTRO rbase-l
================================================
TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED]
In the message body, put just two words: UNSUBSCRIBE rbase-l
================================================
TO SEARCH ARCHIVES:
http://www.mail-archive.com/rbase-l%40sonetmail.com/

Reply via email to