SQL command to send infomessage to users

Is there a command in MSSQL that will allow me to send a message to connected users? I see that the SqlConnection class in C# has an InfoMessage event, I just need to be able to send the message from the server in a stored procedure. I'm guessing this is pretty easy, but I tried googling this and all I found were people trying to send emails from stored procedures.

dcollins2010Asked:
Who is Participating?
 
Anthony PerkinsConnect With a Mentor Commented:
>>Is there a command in MSSQL that will allow me to send a message to connected users?<<
No, there is not.
0
 
dcollins2010Author Commented:
Well is there any code that I can use to prod the users, as a trigger to check for changes? I was going to use Query notifications but those seem to only work with direct SQL queries, whereas I'm using stored procedures, and I also want to explicitly trigger the notifications rather than rely on MSSQL to implicitly send them. I also read that SQL notifications were meant for services monitoring the server, not client applications connected to the server.
0
 
Anthony PerkinsCommented:
You will have to write your own code to do that in your application.  From SQL alone, the best you can do is add T-SQL code to send an email notifying the change.
0
All Courses

From novice to tech pro — start learning today.