i want to delete rows from two tables using one sql statement (inner join).
One table is tblEmployee and other is tblUser and i want to delete all record in both of table whose UserID is EE00001
Create a foreign key on the database table for that field, and set the cascade option to delete. When you delete from the main table, the corresponding entry from the dependent table will also be deleted.
Please Mark As Answer posts that helped you.
"If we learn from our mistakes, I should be brilliant by now."
MCTS - .NET Framework 2.0: Web Applications
I agree with the previous poster. Otherwise you would have to have two separate delete statements which you need to wrap into transaction, so you would need to have an SP for that.
Beware of bugs in the above code; I have only proved it correct, not tried it.