Here is an update statement that should work, but doesn't
after executing it reports 2 rows modified but when the staged and dim records are compared they haven't been updated. I am totally at a loss.
"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck
Code:
Update dbo.Hotel_Ticket_Dimension
Set
HTicket_Comp_Code = s.HTicket_Comp_Code,
HTicket_Folio_Num = s.HTicket_Folio_Num,
HTicket_Voucher_Num = s.HTicket_Voucher_Num,
HTicket_Post_Date = s.HTicket_Post_Date,
HTicket_Billing_Code = s.HTicket_Billing_Code,
HTicket_Comments = s.HTicket_Comments,
HTicket_Coupon_Number = s.HTicket_Coupon_Number,
HTicket_Department = s.HTicket_Department,
HTicket_First_Name = s.HTicket_First_Name,
HTicket_Freq_Traveler = s.HTicket_Freq_Traveler,
HTicket_Last_Name = s.HTicket_Last_Name,
HTicket_Late_Charge_Applied = s.HTicket_Late_Charge_Applied,
HTicket_Rev_Center = s.HTicket_Rev_Center,
HTicket_charge_group = s.HTicket_charge_group,
HTicket_Rev_Description = s.HTicket_Rev_Description,
HTicket_Room_Number = s.HTicket_Room_Number,
HTicket_Sequence_Key = s.HTicket_Sequence_Key,
HTicket_Server_Number = s.HTicket_Server_Number,
HTicket_Split_Ticket = s.HTicket_Split_Ticket,
HTicket_Status = s.HTicket_Status,
HTicket_Ticket_Sequence = s.HTicket_Ticket_Sequence,
HTicket_Type = s.HTicket_Type,
WH_RecDate = GetDate(),
WH_CRC1 = s.WH_CRC1,
WH_CRC2 = s.WH_CRC2
From dbo.zz_Hotel_Ticket_Dimension_stage s with(nolock)
JOIN Hotel_Ticket_Dimension d with(nolock) ON d.HTicket_Comp_Code = s.HTicket_Comp_Code
and d.HTicket_Folio_Num = s.HTicket_Folio_Num
and d.HTicket_Voucher_Num = s.HTicket_Voucher_Num
and d.WH_CRC1 <> s.WH_CRC1
and d.WH_CRC2 = s.WH_CRC2
and d.WH_Current = 1
after executing it reports 2 rows modified but when the staged and dim records are compared they haven't been updated. I am totally at a loss.
"Shoot Me! Shoot Me NOW!!!"
- Daffy Duck