I want to delete rows from two tables using single delete query for .net application.
CREATE TABLE Table1 (User_Id, Name, Address, Group);
CREATE TABLE Table2 (User_Id, Role, Application);
INSERT INTO Table1 VALUES ('Mike', 'Michael', 'NJ', 'Dev');
INSERT INTO Table1 VALUES ('Cla', 'Clark', 'Tampa', 'Supp');
INSERT INTO Table1 VALUES ('Ton', 'Tony', 'Tulsa', 'Tes');
INSERT INTO Table2 VALUES ('Ton', 'AM', 'Science');
INSERT INTO Table2 VALUES ('Cla', 'SM', 'Magazine');
INSERT INTO Table2 VALUES ('Mike','M', 'Sports');
DELETE Table1, Table2
FROM Table1
JOIN Table2 ON (Table2.User_Id = Table1.User_Id)
WHERE Table1.User_Id = '';
Pls advice whether it is a good practice or is it better to go for SP?
mysql. Does this work on SQL Server too?