SQL Server 2005 Delete on cascade
i have serious problem with a delete statement.
The intension is to delete a user out of the user table.
The user id has two constraints and serves as a foreign key in
two other tables named 'messages' and 'comments' as an attribute with name "MadeBy" (both tables have the same naming for the foreign key).
Because I want to ensure integrity is still ok, I dont know which rows of which table to delete first or HOW to make a statement that deletes the rows out of the tables so i can finally delete the user
out of the user table.
Table 'messages' and 'comments' have the foreign key 'user.id'
i want to delete a user row, but i have to delete the rows out of the other tables first. How do i do that?
Thank you very much