[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

sp_send_dbmail sends blank email as a scheduled report

Posted on 2011-09-21
3
Medium Priority
?
364 Views
Last Modified: 2013-03-22
If I run a query that sends the result as an email it works perfect. If I make it a job and fire the job manually, fine again. If I put the job on a schedule it mails the report at the proper time, but its blank without results. The query is obviously identical in each case so this makes no sense. The only diffence is the addition of the schedule. Any ideas?
0
Comment
Question by:bccops
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

Expert Comment

by:TempDBA
ID: 36574429
The addition of the schedule has nothing to do here. Check the account with which the job runs.. When you are running manually, it will use your credential. But the job execution will run on the owners credential. Seems like the output query by the job owner account is not returning anything, may be permission problem.
0
 
LVL 21

Accepted Solution

by:
JestersGrind earned 2000 total points
ID: 36574440
It sounds like a permissions issue.  When you ran it as a query or you ran the job, it ran under your credentials.  When it runs on a schedule, it runs under the credentials of the owner of the job, unless the owner is a sysadmin.  In that case, it runs under the account that the SQL Server Agent is running as.  Or you can go under the advanced properties of the step and explicitly set a user for the job to run as.

Greg

0
 
LVL 5

Expert Comment

by:VENKAT KOKULLA
ID: 36716370
I'm also faced same issue, the thing is that the particular folder which having results file doesn't having proper rights. And also give the complete rights for the SQL server folder that has installed on the drive.

If not try to change the result path location then try again. These are my guess try out this.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question