I have a table Student and the primarykey is studid..
This studid is the foreign key in another table called Class.
I want to delete the records in the table Class...
How can i do it..
Please help me...
Regards,
Mathewyou'll need to drop the foreign keys between the two tables delete the required data, and add the foriegn keys once again.|||
Quote:
Originally Posted by jamesd0142
you'll need to drop the foreign keys between the two tables delete the required data, and add the foriegn keys once again.
Hi James,
Is that the only method to delete those records??
Regards,
Mathew|||What error are you getting when you try to delete these records?
this will help me determine if i have suggested the correct method...
because you shouldnt really get any issues deleting a row frm the table 'class'
i can see y u wud get an error deleting a record from Student table however.|||
Quote:
Originally Posted by jamesd0142
What error are you getting when you try to delete these records?
this will help me determine if i have suggested the correct method...
because you shouldnt really get any issues deleting a row frm the table 'class'
i can see y u wud get an error deleting a record from Student table however.
Hi all,
I didnt try to delete record.. i have to do it,, before that i would like to know whether it is possible or not....
regards,
Mathew|||
Quote:
Originally Posted by mathewgk80
Hi all,
I didnt try to delete record.. i have to do it,, before that i would like to know whether it is possible or not....
regards,
Mathew
Ok, well as i said above, i can's see any problems with deleting from the 'class' table, although you might have a problem deletiung from the 'student' table because;
The studid field in the 'class' table would no longer have a lookup, so droping the foriegn keys first would allow you to delete a record in 'student', although if you have a value in the 'class' table for studid thats not in the 'student' table you 'shouldnt' be able to create the foriegn keys once again...
i hope you understand my logic here :ssql
No comments:
Post a Comment