Wednesday, March 21, 2012

Permissions problem running xp_sendmail

SQL Server 2000 SP3 on Win2k Server SP
Using code: EXEC master..xp_sendmail @.recipients=my_address_goes_here, @.message=''
@.query='SELECT foo FROM bar', @.subject='Subject'
@.attachments='qry.csv'
@.attach_results='TRUE'
@.width=500,@.separator=',
Without @.attachments and @.attach_results the query runs and sends a mail containing data. However, it is a user requirement that I send the file as an attached .csv so it will load directly into Excel. With @.attach_results set to TRUE and no @.attachments, the code fails with xp_sendmail: failed with operating system error 267. I've logged in as the SQL Server service account and set its TEMP and TMP environment variables to a folder over which everyone has full control. When I use @.attachments, whether I specify a path or not I get xp_sendmail: failed with operating system error 5
This looks like a permissions problem, and I've seen several similar postings but without a solution. Can anyone point me in the right direction
Thank
Scott DoughtShould also mention the server is clustered

No comments:

Post a Comment