I have a staging table (in SQL SERVER 2008) with fields with a null value.
I want to insert or update records from a staging table into the main table.
During this I want to make a comparison
Update main set main.field1 = ( if(staging.field1 isnull) then ---- else if(staging.field2 isnull) then ---- else then )
How can I insert the above condition into my insert and update instructions?
Kamil source share