title: SQL Agent job failed with [SQLSTATE 23000] (Error 2627)
body: <p>I have this SQL Server agent job that runs on a daily basis that calls &amp; 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.</p>
  
  <p>Here is the error message:</p>
  
  <blockquote>
    <p>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)  <b>Ayopay Indonesia Reload 09
    Mar 2016</b><br/><br/><b>TOTAL RELOAD</b>IDR
    39,982,651.00RM
    11,407.84<b>TOTAL NEW USER</b>16<br><br>&nbsp;<b>SUCCESS</b><b>INCOMPLETE</b><b>CHANNEL</b><b>QTY</b><b>IDR</b><b>RM</b><b>QTY</b><b>IDR</b><b>RM</b><b>OFFLINE RELOAD</b>BCA3720,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.91<b>TOTAL</b><b>70</b><b>33,982,651.00</b><b>9,695.92</b><b>44</b><b>13,709,850.00</b><b>3,911.69</b>&nbsp;<b>ONLINE RELOAD</b>Finnet -
    ATM75,000,000.001,426.60
  </blockquote>
  
  <p>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. </p>
  
  <p>The server is running on </p>
  
  <pre><code>Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64) 
  Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.1 &lt;X64&gt; (Build 7601: Service Pack 1)
  </code></pre>
  
  <p>My 1st attempt is to look for the object name 'dbo.SnapShot', but to no avail. Any help is much appreciated. TQ</p>