Calling Windows service from sql server 2005

Posted on 2007-08-03
Last Modified: 2013-11-26

I have made a windows service in dot net 2005 and
I want to call this windows service when I insert a record in the table.So is there any machnisam ,we can call the windows service whenver any record is inserted in the table.

Please give the solution if there is.
Question by:HanuSoftware
    LVL 6

    Expert Comment

    When you wrote the Windows Service, how did you design it to be called?
    LVL 13

    Accepted Solution

    As a starting point, you can create a trigger on a table ("CREATE TRIGGER x ON mytable FOR INSERT AS ...")

    OR: you can use the SQL Service Broker.

    You can either have a CLR trigger or use your .NET code to talk to the service broker.


    However, the ultimate answer really depends on how you wrote your Windows Service (and whether or not a Windows Service is really the most appropriate location for your custom-code.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
    The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now