locked
CLR Triggers how-to RRS feed

  • Question

  • User-1335602170 posted

    Hi everyone,

     

    im new in the field of SQL triggers, never use that before. Am using VS2008 and SQL 2008. On my server, it is continuously monitoring serial port, whenever a message comes in, it will add a new row to a table. After the row has been added, a trigger should fire and display the incoming info immediately on the user screen, plus some actions should be done on the web page.

     

    i dont know how to merge the CLR Trigger (which is running in the SQL server) with my c# application code. What i normally see is the trigger will do some SQL databse thing. Somebody please show me?

    thanks.

     

     

    Tuesday, November 11, 2008 8:14 AM

Answers

  • User1821809770 posted

    If you are talking about updating a web page then there is nothing you can do with the CLR trigger to update the user interface.  If you are talking about a windows app then you could build a listener and send some type of event out of the trigger which is directed at the client ... but either way I don't think that is the correct approach.

    The better way to program this (and the only way for a web page) is to have the client regularly query for updates, either through javascript, meta tag refreshes, or a timer/polling service for a windows based app.

     If you want to provide some more information about your application I can probably provide a better answer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 11, 2008 9:21 AM

All replies

  • User1821809770 posted

    If you are talking about updating a web page then there is nothing you can do with the CLR trigger to update the user interface.  If you are talking about a windows app then you could build a listener and send some type of event out of the trigger which is directed at the client ... but either way I don't think that is the correct approach.

    The better way to program this (and the only way for a web page) is to have the client regularly query for updates, either through javascript, meta tag refreshes, or a timer/polling service for a windows based app.

     If you want to provide some more information about your application I can probably provide a better answer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 11, 2008 9:21 AM
  • User-196139804 posted

    Hi everyone,

        I am new to asp .net & sql server.

    In one of my project i need to use clr triggers for inserting data from one database to another weekly once...

    Please suggest me that how to write clr trigger to solve my problem

    Monday, November 22, 2010 8:08 AM