vaidyanathanpc
Programmer
Hi,
I have written a procedure to send mail.
CREATE procedure PCWishes
as
declare @rc int
Begin
exec @rc = master.dbo.xp_sendmail @recipients='Murali_K', @Subject='Service Anniversary!!',@Message='Hello'
if @rc = 1
begin
print 'Error'
end
End
The mail id given in the recepients list is an invalid mail id. When I execute this procedure from the query analyzer, I get the the following error message.
Server: Msg 17921, Level 18, State 1, Line 0
A recipient was specified ambiguously.
Error
In the above error message, I want to suppress the SQL Server error message and display only the error message ("Error"
given in the print statement in my stored procedure. How do I do this?
Thanks in advance
P.C. Vaidyanathan
I have written a procedure to send mail.
CREATE procedure PCWishes
as
declare @rc int
Begin
exec @rc = master.dbo.xp_sendmail @recipients='Murali_K', @Subject='Service Anniversary!!',@Message='Hello'
if @rc = 1
begin
print 'Error'
end
End
The mail id given in the recepients list is an invalid mail id. When I execute this procedure from the query analyzer, I get the the following error message.
Server: Msg 17921, Level 18, State 1, Line 0
A recipient was specified ambiguously.
Error
In the above error message, I want to suppress the SQL Server error message and display only the error message ("Error"
Thanks in advance
P.C. Vaidyanathan