Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net send

Status
Not open for further replies.

TheJFM

Programmer
Jun 13, 2002
65
GB
On the system I am working on I cannot use e-mail notification i.e. xp_sendmail.

Is there a way to include a net send within a stored procedure in the same way that xp_sendmail can be used?

Thanks in advance
 
You can use xp_cmdshell to execute system commands like NET SEND. Look it up in BOL for info.

--James
 
Now wasn't that painfully obvious - why did I not think of that duh?

Thanks so much and good weekend to you
 
I tried this:

Declare @cmd varchar(50)

Set @cmd = 'net send uName this is a test'



exec Master..xp_cmdshell @cmd


but get the error:

output
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
An error occurred while sending a message to AVIMARCOUK.

NULL
The message alias could not be found on the network.

NULL
More help is available by typing NET HELPMSG 2273.

NULL

(6 row(s) affected)

Any ideas???
 
You may need quotes around your message. I just tried this and it worked fine:

Code:
DECLARE @cmd varchar(100)
SET @cmd = 'net send jamesl "this is a test"'
EXEC master..xp_cmdshell @cmd

--James
 
Thanks

I tried that - still did not work

I'll have another bash on Monday
 
Worked it out - net send is not enabled on the server on which SQL Server resides and I am not being allowed to enable it.

However the jobs when they succeed/fail can send a message via net send so there must be another way to do it programatically.

Any ideas?

 
All resolved. Messeneger service has been enabled.

Thankd for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top