October 2, 2002 at 3:03 pm
Server: Msg 18025, Level 16, State 1, Line 0
xp_sendmail: failed with mail error 0x80004005
Queries processed: 0
Having trouble getting actual queries recognized by sp_processmail. If I send an email with SELECT @@servername, it works fine. As soon as I SELECT * FROM <table> or try to execute a stored procedure, I get the error mentioned above.
Any ideas why?
Be great!
Michael
Be great!
Michael
October 2, 2002 at 7:12 pm
Hi Michael,
Can you give us an example of your query using sp_processmail?
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
October 3, 2002 at 7:49 am
SQL2000 w/SP2.
For testing purposes. The email's subject is SQL:bo, the body says SELECT @@servername. In ISQL - EXEC sp_processmail @subject = 'SQL:bo', @dbuse = 'bo'. This returns an email with an attachment that has the servername; what I would expect.
Again for testing purposes. The email's subject is SQL:bo, the body says SELECT * FROM def_cmt . In ISQL - EXEC sp_processmail @subject = 'SQL:bo', @dbuse = 'bo'. This gives the error that is in the original email.
I have also tried to execute a stored procedure within the body of the email and that too returns the error message.
Be great!
Michael
Be great!
Michael
October 3, 2002 at 8:48 am
1) Are you able to send successfully through Outlook?
2) Are you on Exchange 2000?
K. Brian Kelley
http://www.truthsolutions.com/
Author: Start to Finish Guide to SQL Server Performance Monitoring
http://www.netimpress.com/shop/product.asp?ProductID=NI-SQL1
K. Brian Kelley
@kbriankelley
October 3, 2002 at 9:14 am
Yes
No - 5.5
Be great!
Michael
Be great!
Michael
October 3, 2002 at 9:33 am
Have you tried to just select few columns in select statement?
October 3, 2002 at 9:43 am
Yes, same error.
Be great!
Michael
Be great!
Michael
October 3, 2002 at 9:55 am
Try select db_name() and be sure of your context.
Steve Jones
October 3, 2002 at 11:49 am
Huhm!?!?
SELECT db_name() works, returns MASTER, only if I do not inlcude @dbname = '<database>'. If I include that, it fails.
I also tried send the SELECT statement with the db hardcoded and it too fails.
Be great!
Michael
Be great!
Michael
October 3, 2002 at 11:51 am
Sorry I meant @dbuse not @dbname.
Be great!
Michael
Be great!
Michael
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply