Wednesday, March 21, 2012

Permissions problem running xp_sendmail

SQL Server 2000 SP3 on Win2k Server SP3
Using code: EXEC master..xp_sendmail @.recipients=my_address_goes_here, @.mess
age='',
@.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 con
taining data. However, it is a user requirement that I send the file as an a
ttached .csv so it will load directly into Excel. With @.attach_results set t
o TRUE and no @.attachments,
the code fails with xp_sendmail: failed with operating system error 267. I'v
e logged in as the SQL Server service account and set its TEMP and TMP envir
onment variables to a folder over which everyone has full control. When I us
e @.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 posting
s but without a solution. Can anyone point me in the right direction?
Thanks
Scott DoughtyShould also mention the server is clustered

No comments:

Post a Comment