Link to home
Start Free TrialLog in
Avatar of dcollins2010
dcollins2010

asked on

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.

ASKER CERTIFIED SOLUTION
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dcollins2010
dcollins2010

ASKER

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.
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.