How do I state - If a field in my table is NULL only then do the update.
For example:
IF customer_day_phone (from my #invoice table) where id_key = @id_key -matches my parameter - is null. Then run my update.
But i'll have multiple rows coming back and I only want to update those who are NULL.
IF select customer_day_phone from #invoice where id_key = @id_key and customer_day_phone is null
BEGIN
...
END
I need the IF statement I can't simply use where day_phone is NULL because its a two part update. The first part updates the value if the field is null the second update formats the data (but I don't want it formatted if it wasn't updated only if it was).
and customer_day_phone is nulland customer_day_phone is null.