View previous topic :: View next topic |
Author |
Message |
AMABITxS n00b
Joined: 12 Aug 2004 Posts: 24 Location: Goldsboro, NC
|
Posted: Wed Feb 01, 2006 8:54 pm Post subject: Records are still in my sql database after I delete them |
|
|
I have a data base that uses the SSN of my employees as the primary key. A week ago the computer locked up while I was in the middle of updating two records, and now when I search for the SSN of employeeA, I get the record from employeeB. For example
SELECT * FROM Employee WHERE (((Employee.SSN)="123-45-6789"));
Returns the record for EmployeeA. Since 123-45-6789 is EmployeeA's SSN that is fine, but
SELECT * FROM Employee WHERE (((Employee.SSN)="987-65-4321"));
where 987-65-4321 is EmployeeB's SSN still returns the record for EmployeeA.
I deleted both records by using the delete commands:
DELETE * FROM Employee WHERE (((Employee.SSN)="123-45-6789"));
DELETE * FROM Employee WHERE (((Employee.SSN)="987-65-4321"));
and then I re-added EmployeeA. But I still have the same problem. Only now when I select for EmployeeB's SSN (who's record has not been re-added).
SELECT * FROM Employee WHERE (((Employee.SSN)="987-65-4321"));
I get a record that returns with all feilds reading "#Deleted" (even the SSN feild)
I did not build this database, I just inherited it from someone who left a while ago, and I am really a novice when it comes to db management.
Does anyone have any Ideas to fix my database? |
|
Back to top |
|
|
adaptr Watchman
Joined: 06 Oct 2002 Posts: 6730 Location: Rotterdam, Netherlands
|
Posted: Wed Feb 01, 2006 10:02 pm Post subject: |
|
|
- what kind of a database server: MySQL, Oracle, PostGres, what ?
- where did you learn SQL
- have you examined the database schema ?
- is it (supposed to be) fully transactional ?
- if so, what does the transaction log say ? _________________ >>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Feb 01, 2006 10:15 pm Post subject: Re: Records are still in my sql database after I delete them |
|
|
AMABITxS wrote: | A week ago the computer locked up while I was in the middle of updating two records, and now... |
Look at the docs for your particular DBMS, regarding repairing the database files - it sounds like database corruption. |
|
Back to top |
|
|
AMABITxS n00b
Joined: 12 Aug 2004 Posts: 24 Location: Goldsboro, NC
|
Posted: Wed Feb 01, 2006 10:30 pm Post subject: |
|
|
Ok, thanks guys. I'll let you know what I find. |
|
Back to top |
|
|
|