In looking through the event log on our SQL server, I noticed that there is a job that runs every minute which fails and therefore logs an error message. The job is "Cleanup Logins" which executes dbo.Login_proc. How can I troubleshoot to find out why this job fails every time?
If it is Microsoft SQL, you should be able to go to the Job History and see the details of why the job failed.
Okay. In looking at the MSSQL Job History, I see that it tells me that "The login_proc procedure is already running on this database."
So, is the proc not finishing cleanly and simply stuck rendering subsequent attempts to execute it as failures?
How do I clean this up so I do not get an error every minute?
May have gotten stuck. If you right-click on the Job, and select "Stop Job" see if that stops it. Then try running it again, and see if it completes.
You can also go to "Job Activity Monitor" to see more details.
Attempt to stop the job failed because the job is not running.
I'm not a programmer, but I can see that the login_proc has code built in that prevents it from executing if it is already running. That code is tripping every time it is run.
It is executing sp_getapplock which is apparently returning a result that is < 0 causing it to error out. However, when I execute sp_releaseapplock, I get an error indicating that it cannot release the application lock because it is not currently held.