0
votes

I have this SQL Server agent job that runs on a daily basis that calls & execute 2 stored procedures. The issue is that the job fails, but not on a daily basis. The last job execution failure was on 8th March 2016. Then the job succeeded on 9th March 2016. Today (10th March 2016), the job failed again.

Here is the error message:

Executed as user: DB2-AYOPAY\db_service. Violation of UNIQUE KEY constraint 'IX_SnapShot'. Cannot insert duplicate key in object 'dbo.SnapShot'. The duplicate key value is (2, 1, 1, 10, 3, 2016). [SQLSTATE 23000] (Error 2627) Mail (Id: 1079) queued. [SQLSTATE 01000] (Error 0) The statement has been terminated. [SQLSTATE 01000] (Error 3621) Ayopay Indonesia Reload 09 Mar 2016

TOTAL RELOADIDR 39,982,651.00RM 11,407.84TOTAL NEW USER16

 SUCCESSINCOMPLETECHANNELQTYIDRRMQTYIDRRMOFFLINE RELOADBCA3720,373,800.005,813.05112,591,000.00739.26BRI156,730,000.001,920.20216,300,000.001,797.52Mandiri186,878,851.001,962.67124,818,850.001,374.91TOTAL7033,982,651.009,695.924413,709,850.003,911.69 ONLINE RELOADFinnet - ATM75,000,000.001,426.60

I would appreciate if someone could guide/lead me into the right direction. I have no prior experience in handling error messages such as this. I know that there were similar error messages posted b4, but i still could not wrap my head around it, due to my inexperience.

The server is running on

Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64) 
Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

My 1st attempt is to look for the object name 'dbo.SnapShot', but to no avail. Any help is much appreciated. TQ

1

1 Answers

1
votes

You need to further read on unique constraints,what does this means is

Violation of UNIQUE KEY constraint 'IX_SnapShot'. Cannot insert duplicate key in object 'dbo.SnapShot'. The duplicate key value is (2, 1, 1, 10, 3, 2016). [SQLSTATE 23000] (Error 2627) Mail (Id: 1079) queued. [SQLSTATE 01000] (Error 0) The statement has been terminated. [SQLSTATE 01000] (Error 3621) Ayopay Indonesia Reload 09 Mar 2016

You have unique key with this value

(2, 1, 1, 10, 3, 2016)

and your job is trying to insert again a key with same value.