I’m trying write a routine in SQL Server that, when run, would traverse specified tables and, if a specific column contains a value, update another value. In pseudo code:
select * from table1
if column1 = true
{
update table2.column1 with value where table2.column2.value = table1.column2.value
}
Basically, traverse table1 and if the value in a specific column is true, update the value of another table’s column1 where that row’s column2 matches table1‘s column2
Thanks
You don’t need the
IF, just use aWHEREclause: