SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Database mail with @query issue!


Database mail with @query issue!

Author
Message
Anders Pedersen
Anders Pedersen
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3342 Visits: 902
bensala (4/2/2009)
the issue is with your SQL service not able to "lookup" the AD account... Here is the cmd that DBMail runs:

EXEC sys.xp_logininfo
@acctname = 'Domain\User'


If this command kicks back an error... your dbmail is going to fail. There is an option in AD to hide a user to prevent someone from being able to list all the AD users. If this option is enabled for the user in question... DBMail will fail. MS knows about this issue and as far as I know... has no intention of fixing it.



The first thing to check if you get this error is most likely to check that the accounts SQL is running under has not been disabled. At least that is what I found to be the problem.

Could send emails without the query, as soon as I added the query and set it to include result as file, it bombed with the error above. I did not try with result set included in the body of the email.
karsten.jacques
karsten.jacques
Grasshopper
Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)Grasshopper (20 reputation)

Group: General Forum Members
Points: 20 Visits: 375
Thank you bensala.
Russell Fox-464445
Russell Fox-464445
Grasshopper
Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)Grasshopper (24 reputation)

Group: General Forum Members
Points: 24 Visits: 132
I had a similar issue and the solution was just to make sure the @query_result_width had a value (250).
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search