fikir
Programmer
- Jun 25, 2007
- 86
Hello every one, hope you had a wonderful july 4th weekend
I have a patientVisit table wich is referencing itself, here is the table
patientVisit
visit_ID Visitor_ID Visitor_Name VisitDate LastVisit
1 1001 aab 01/01/07 Null
2 1001 aab 03/01/07 1
3 1002 Kal 04/04/06 Null
4 1003 Al 06/05/05 Null
5 1002 Kal 05/05/07 3
6 1001 aab 05/03/07 2
7 1002 Kal 07/07/07 5
A foriegn key is defined on LastVisit referening VisitID
I want to delete all records from PatientVisit table
if I do 'delete from patientVisit', the statement fails because it is there is a foreigh key reference.
How doI write a statement which can delete every record in the patientVisit table
Thanks,
I have a patientVisit table wich is referencing itself, here is the table
patientVisit
visit_ID Visitor_ID Visitor_Name VisitDate LastVisit
1 1001 aab 01/01/07 Null
2 1001 aab 03/01/07 1
3 1002 Kal 04/04/06 Null
4 1003 Al 06/05/05 Null
5 1002 Kal 05/05/07 3
6 1001 aab 05/03/07 2
7 1002 Kal 07/07/07 5
A foriegn key is defined on LastVisit referening VisitID
I want to delete all records from PatientVisit table
if I do 'delete from patientVisit', the statement fails because it is there is a foreigh key reference.
How doI write a statement which can delete every record in the patientVisit table
Thanks,