Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
maqk
Starting Member
1 Post |
Posted - 2007-08-02 : 07:50:40
|
I want to delete all those rown from a table who have same value for a field (the col was supposed to be unique - NOT PK though) & those rows PK are not present as a FK in another tablewell its all so confusing so let metell in simple wordsTable-1 - 'CM-Company_Master' [Primary Table]Table-2 - 'CY-Company_Years' [Primary Table]CM.comapny_id is FK in CY tableCM has another field - Company_Code - This field is supposed to be UNIQUE but unfortunately the data is inconsistent as NO CONSTRAINT was enforced earlier in the DB Designthere are rows iun CM table who have inconsistent data in the table (samevalue for 'company_code' field)but has no reference in the CY table cause when the data was entered by the DEOs, some company data got entered twicenow i want to delete those rows who have inconsistent data in the table & has no reference in the CY table cause when the data was entered by the DEOs, some company data got entered twiceplease helpMAQK - One true Lord exists |
|
|
|
|