Here is a quick and simple way to test the outcome of your changes before actually executing the change.
BEGIN TRANSACTION;
UPDATE
DBname.dbo.Tablename
SET
ColumName = 1
OUTPUT
inserted.*
FROM
DBname.dbo.Table1 T1
JOIN DBname.dbo.Table2 T2 ON T1.ID = T2.ID1
JOIN DBname.dbo.Table3 T3 ON T3.ID = T1.ID3
WHERE
T3.Status = 1
ROLLBACK TRANSACTION;
The important parts are:
-
BEGIN TRANSACTION – Starts the transaction.
-
OUTPUT inserted.* – Outputs the result of the change to the results window.
-
ROLLBACK TRANSACTION – Reverses the effects of the change, leaving the data in the same state it started in.