clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2335732 fiddles created (27462 in the last week).

CREATE TABLE dbo.TestTable1 (RowData varchar(255) NULL); INSERT dbo.TestTable1 VALUES ('Test data');
1 rows affected
 hidden batch(es)


IF OBJECT_ID(N'dbo.TestTable2', 'U') IS NOT NULL BEGIN UPDATE TestTable2 SET RowData = 'Text update'; END; ELSE BEGIN PRINT 'Table 2 does not exist'; END;
Table 2 does not exist
 hidden batch(es)


IF OBJECT_ID(N'dbo.TestTable1', 'U') IS NOT NULL BEGIN UPDATE dbo.TestTable1 SET RowData = 'Text update'; END; ELSE BEGIN PRINT 'Table 1 does not exist'; END;
1 rows affected
 hidden batch(es)