So I have some procs I inherited that I am trying to clean up. One of the things I see over and over in them is the following:

```
Update Table_A
Set A.ColX = B.Colx
From Table_A A
 Join Table_B B on B.col1 =A.col1
    and B.col2 = A.col2

Update Table_A
Set A.ColX = B.Colx
From Table_A A
Join Table_B B on a.col1 =b.col1
     and B.col2 is null

```

Now , I have tried to combine these to make them a single query using the following different final lines (not at the same time!):

```
1) and (B.col2 = A.col2 or B.col2 is null)
2) and (isnull(B.col2,'') = COALESCE(a.col2, ''))

```

However, it always seems to do one of the updates, not both. I feel like I am missing something rather obvious, Is there a good way to combine these two queries?

thanks