How To Send Message To All Connected User On Insert In A Table

  • Hi all

    I have A order table.

    I want to send information to all my user when a new record insert in this table.

    how it possible?

    thanks in advance

  • You will have to make use of Insert Triggers.. to know more about trigger, go through the following like

    TRIGGERS - MSDN - Click Here

    MOre specifically , look out at the Example 2 in taht page..It is exactly what u requested for..

    Hope this helps..

    Cheers!!

  • thanks for reply

    i using window application develop in .net.

    when a row insert in a table.

    then we want to provide alert message of all user which is using my application.

    in msdn example only one user can get this message which is insert update or delete a row.

    i want to send alert to all user by sql server.

    thanks for more help......

  • Developer, MSDN link for sp_send_dbmail says that it is possible to send one single mail to multiple users , as in [ , [ @recipients = ] 'recipients [ ; ...n ]' ]

    You wil have to create a string that will have the e-mail addresses of all the users delimited by semi-colon (;). Then pass this sting to the @recipients parameter of sp_send_dbmail.

    Hope this helps you buddy!:-)

  • Thanks

    u are right

    but we don't want to send mail to all user.

    i want to pass a message in message box and want to display on screen of all systems in local area network.

  • Then u can create a SQL-CLR procedure, use it inside the TRIGGER definition... inside the CLR, write some code that will relay the messages through LAN..

    I can only get you this far buddy, coz' thats all idea i have in my hummingbird-brain!! 😀

    Hope it helped you, Cheers!

  • Developer 2005 (4/26/2010)


    Thanks

    u are right

    but we don't want to send mail to all user.

    i want to pass a message in message box and want to display on screen of all systems in local area network.

    in the past, you used to be able to use NET SEND to all the machines on a network; however, because of someone adapting that to throw spam around, that functionality is almost always locked down and disabled.

    I've done something like a "Todo" or task list in my actual application/executable, that checks a specific table periodically (once a minute or so), and if it finds any recods since the last check, changes an icon to sonething to try and grab the users attention.

    You could do something similar.

    Now the real question is: why do you feel the need to alert everyone that there is a new record added? does everyone really need to know the moment it happens?

    If you explain the busines sprocess better, we might offer some good advice.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (4/26/2010)


    ...

    in the past, you used to be able to use NET SEND to all the machines on a network; however, because of someone adapting that to throw spam around, that functionality is almost always locked down and disabled.

    I've done something like a "Todo" or task list in my actual application/executable, that checks a specific table periodically (once a minute or so), and if it finds any recods since the last check, changes an icon to sonething to try and grab the users attention.

    You could do something similar.

    Now the real question is: why do you feel the need to alert everyone that there is a new record added? does everyone really need to know the moment it happens?

    If you explain the busines sprocess better, we might offer some good advice.

    I used to do it the same way in the past but now I'm using ServiceBroker. If you need to get the information as soon as possible but the event fires just a few times a day, SB works just fine.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • but with Service Broker, you are sending emails and such, right? I thought the original poster was saying he wants a form to open up on everyone who is using his application, and he shied away from the email suggestion... Are you doing something different than what i'm thinking?

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Basically, the SB does the same like the job that did run every minute (data transfer across servers and email notification).

    I haven't had the need to call an external application yet. But let's assume there is an executabel application that would be able to open such a form on a given IP then you could call that program with the IP as a parameter using xp_cmdshell. (I don't know if or how that would work in a virtualized environment, but that's a different story...)

    What I've read, starting with SS2K8 it's possible to "communicate" with a .net app (using External Activator), as long as the app is able to send a response.

    Example: http://blogs.msdn.com/sql_service_broker/archive/2010/03/10/Sample-activated-application.aspx



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • thanks to all for participates

    according to my need.

    i have a compliant table in my CRM Database.

    when a new complaint insert in table . then we want to notify all users to take action on that complaint.

    In Case of NET SEND we pass a message by windows services.i don't want this.i want pass message by my application rather then windows.

    thanks

  • Thanks To Participles

    According My Need I have a complaint table.

    when a new record insert in this table then we want to send message to all user which is using my application for take action on this complaint.

    we can send message using net send but this method pass message using window services i want send message using my application.

Viewing 12 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic. Login to reply