We help IT Professionals succeed at work.

SQL: Default Database Integrity Jobs Failing

Last Modified: 2017-05-25

This morning, I reviewed the SQL Server Agent of SQL Server 2016.  There are what I believe are two default database integrity jobs that come with SQL.  They are both failing, according to the Agent.

I say that they are "default" jobs, because they are the ones that reference "SYSTEM_DATABASE" and "USER_DATABASES" and the one step for each job appears to be written in PowerShell scripting.

Anyway, since I did not have access to Event Viewer, I reviewed the results in the Agent.  The only thing that the Agent could tell me is that the person that is supposed to get e-mails about failures could not be e-mailed.  I think that the Agent was saying that database mail setup could not be configured or was not set up or something along those lines.

In any case, is the reason for the failure because of the simple fact that this person could not be e-mailed?  The Agent stated that the last step invoked was Step 1--the only step of each job.  

I may simply try to set up my own jobs for the system and user databases.

Thank you!

Watch Question

Vitor MontalvãoIT Engineer
Distinguished Expert 2017

There's no such default agent jobs.
With that said, somebody created those jobs. Maybe those are part of the maintenance jobs (check under the Management / Maintenance Plans). If true, edit the maintenance plan and remove or replace the email address that's configured there.


Thank you, Vitor!

So, the issue with e-mailing is what is causing the Agent to display these as failed jobs.  But, the database integrity check has been running.  Is that all correct?



I removed the e-mailed person and manually ran the job.  It failed.

Here is the script that someone created:

sqlcmd -E -S $(ESCAPE_SQUOTE(SRVR)) -d DBAMgmtInfo -Q "EXECUTE [dbo].[DatabaseIntegrityCheck] @Databases = 'SYSTEM_DATABASES', @LogToTable = 'Y'" -b

What's wrong with this, then?  Frankly, the script is Greek to me.

Vitor MontalvãoIT Engineer
Distinguished Expert 2017

The job is running a sqlcmd? That's make not sense.
What's the error now?


There is no real error given.  I removed the requirement to e-mail an alert, last night.  Yet, the job still failed without telling me why.

Fortunately, I noticed that someone else had already created a successful job that runs database integrity.  So, perhaps, this is all a moot point.  It would be nice to know why these two jobs fail, but...

IT Engineer
Distinguished Expert 2017
Unlock this solution and get a sample of our free trial.
(No credit card required)

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.