Question : t-sql arithmetic overflow error on update

This procedure has been working without fail for months and now all of a sudden it breaks. There have been no schema changes so something in the data must be causing this to fail but I can't figure it out.

All this sql is doing updating one table from another table. They IDs are in both tables.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
UPDATE account_master.dbo.accounts

SET 
	accounts.[LastName] = sfaccounts.LastName
	,accounts.[FirstName] = sfaccounts.firstname
	,accounts.[Salutation] = sfaccounts.salutation
	,accounts.[date_created] = sfaccounts.createddate
	,accounts.[creator_id] = ''
	,accounts.[date_modified] = sfaccounts.lastmodifieddate
	,accounts.[modifier_id] = ''
	,accounts.[PersonBirthdate] = sfaccounts.personbirthdate
	,accounts.[fundgroup] = sfaccounts.fund_group__c
	,accounts.[marital_status] = sfaccounts.marital_status__c
	,accounts.[patient_ssn] = sfaccounts.patient_ssn__c
	,accounts.[Annual_Household_Income] = cast([Annual_Household_Income__c] as float)
	,accounts.[Household_Size] = sfaccounts.household_size__c
	,accounts.[Sex] = sfaccounts.sex__c
	,accounts.copay_override = sfaccounts.copay_override__c
	,accounts.[Backdate_Flag] = case when [Backdate__c]='true' then 1 else 0	END
	,accounts.[Grace_period_flag] = case when [grace_period__c] ='true' then 1 else 0	END
	,accounts.grace_override = grace_period_override__c
	,accounts.[freeze_flag] = case when [assistance_freeze__C]='true' then 1 else 0	END
	,accounts.termination_flag = case when termination_flag__c='true' then 1 else 0	END
	,accounts.application_complete = sfaccounts.application_complete__c
	,accounts.application_complete_date = sfaccounts.application_complete_date__c
	,accounts.[Final_Approval] = sfaccounts.final_approval__c
	,accounts.[Compliant] = sfaccounts.compliant__c
	,accounts.[Noncompliant_Reason] = sfaccounts.noncompliant_reason__c
	,accounts.[noncompliant_valid] = sfaccounts.noncompliant_valid__c
	,accounts.[noncompliant_date] = sfaccounts.noncompliant_date__c
	,accounts.[copay_status] = sfaccounts.status__c
	,accounts.[therapy] = sfaccounts.therapy__c
	,accounts.termination_reason = sfaccounts.termination_reason__c
	,accounts.lisa = sfaccounts.lisa__c
	,accounts.pharmacy_id = sfaccounts.pharmacy_id__c
	
	-- keys
	,accounts.salesforce_id = sfaccounts.id
	,accounts.related_pharmacy_id = sfaccounts.related_pharmacy__c
	,accounts.previous_pharmacy_id = sfaccounts.previous_pharmacy__c
	
	
FROM
	
	sf.dbo.account sfaccounts
	
WHERE

	accounts.AccountID = sfaccounts.account_id__c

Answer : t-sql arithmetic overflow error on update

Are all the data types of the columns between the two tables exactly the same?
Random Solutions  
 
programming4us programming4us