Microsoft KB Archive/286253

= FIX: Multiple SQL Agent Jobs Launched At The Same Time May Fail With Primary Key Error Message =

Article ID: 286253

Article Last Modified on 10/9/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q286253



BUG #: 351502 (SHILOH_BUGS)



SYMPTOMS
If multiple SQL Agent jobs owned by the same login are scheduled to start at the same time, one or more of the jobs may fail with an error message similar to:

The job failed. Unable to determine if the owner (DOMAIN\user) of job CopyM1ToMx has server access (reason: Violation of PRIMARY KEY constraint 'PK__syscachedcredent__0AD2A005'. Cannot insert duplicate key in object 'syscachedcredentials'. [SQLSTATE 23000] (Error 2627) The statement has been terminated. [SQLSTATE 01000] (Error 3621)).



CAUSE
SQL Agent keeps track of whether a job owner has access to the server and whether the job owner is a member of the sysadmin role. If two jobs owned by the same login are started at the same time, both jobs may attempt to insert a row into the same table, rather than one of them performing the insert and the other performing an update. When both jobs attempt to insert the row into the table, a primary key violation occurs.



RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack

Hotfix
NOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 1.

The English version of this fix should have the following file attributes or later:   File name     Platform --

s80242i.exe  x86 NOTE: Due to file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.



WORKAROUND
Stagger the start times for the jobs that are owned by the same login so that only one job is started at a time.



STATUS
Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

Additional query words: sp_sqlagent_has_server_access

Keywords: kbbug kbfix kbqfe kbsqlserv2000sp1fix KB286253

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.