Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 xp_sendmail

Author  Topic 

mikebird
Aged Yak Warrior

529 Posts

Posted - 2008-02-27 : 09:23:59

I need to send some xp_sendmail and have been practising with it, sending simple messages which arrived OK. I've got a query which runs OK, to return the result in the message

After all of this I have a SQL statement ready to put int a stored procedure and just got an error that the crucial line

exec xp_sendmail

returns

'Server: Msg 2812, Level 16, State 62, Line 4
Could not find stored procedure 'xp_sendmail'.'

It's been finding it throughout all the tests I've been doing. I've checked permissions, but it's not about that - it's that it can't be found - as if it's been deleted. It's still there as before! It's an extented SP, so I can't edit it. Have you ever encountered this before??

Thanks

jhocutt
Constraint Violating Yak Guru

385 Posts

Posted - 2008-02-27 : 09:28:21
exec master..xp_sendmail

"God does not play dice" -- Albert Einstein
"Not only does God play dice, but he sometimes throws them where they cannot be seen."
-- Stephen Hawking
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2008-02-27 : 10:57:49
I've managed to supply the required prefixes to identify xp_sendmail now, and the parameters seem to be right. I get the following error when running. Can you tell me what it means?

ODBC error 7410 (42000) Remote access not allowed for Windows NT user activated by SETUSER.


Maybe I can fix some security here...?

Thanks
Go to Top of Page

mikebird
Aged Yak Warrior

529 Posts

Posted - 2008-02-27 : 12:42:19
The way to avoid this error is to cut the query to something really simple - select getdate() is successful so everything goes sweetly, and the script I want to send in the @query parameter works fine run by itself, so maybe there are restrictions on the xp_sendmail abilities? The result is only about 5 rows by 5 columns. I can't see why that nast error is generated.

Has anyone encountered this before? The script in @query is thus:

-- The SOR Codes in PENDING mode
select distinct ccs_qos_item_ref "SOR Code",
ccs_qos_title "Description",
ccs_qos_quoted_price#6 "Cost",
ccs_quo_user_date#1 "Completed Stamp" -- current datetime from jobcompletedUpdate
from [ken-sql-002].ConstructMobile.dbo.ccs_q_sections qs
inner join [ken-sql-002].ConstructMobile.dbo.ccs_quotes q
on q.ccs_quo_quote_number = qs.ccs_qos_quote_number
where q.ccs_quo_analysis_code = 'PENDING'

Thanks
Go to Top of Page
   

- Advertisement -