I have a staging table (in SQL SERVER 2008) with nullable fields.
I want to Insert or Update the records from the staging table to main table.
During this I want a comparison to be done
Update main
set main.field1 = (
if(staging.field1 isnull)
then ----
else if(staging.field2 isnull)
then ----
else
then
)
How can I embed the above condition in my insert and update statements?