Link to home
Start Free TrialLog in
Avatar of frosty1
frosty1

asked on

test sql deleting

I have the following query

DELETE o
FROM Orders o LEFT OUTER JOIN  OrderItems On o.Id = OrderItems.OrderId
Where OrderItems.OrderId IS NULL and o.OrderStatus > 1  

is there a way i can test this script but not let it actually run so i can see the results

I can of course use a select but i'm not sure the results are the same.

select *
FROM Orders o LEFT OUTER JOIN  OrderItems On o.Id = OrderItems.OrderId
Where OrderItems.OrderId IS NULL and o.OrderStatus > 1  
Avatar of cheers4beers
cheers4beers
Flag of United States of America image

What database platform are you using? SQL Server or Oracle?
Avatar of frosty1
frosty1

ASKER

mssql
ASKER CERTIFIED SOLUTION
Avatar of Ryan McCauley
Ryan McCauley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> I can of course use a select but i'm not sure the results are the same.

With SELECT statement, you will get those records which can be deleted with DELETE statement.