SQL Server's Data Change Notification

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nick Pritchard

    #1

    SQL Server's Data Change Notification

    Well, there are a couple ways you could do that.

    You could write a windows service with a
    System.Timers.T imer object, that fires an event ever 15
    minutes. Or, you could use a trigger on the table you are
    evaluating. On update for your table, your trigger fires
    executing a piece of code that could be a SQL job, or an
    actual executable you had written in VB or VB.net. The
    easiest programatic way would probably be the service
    though.

    Cheers...

    [color=blue]
    >-----Original Message-----
    >I am writing a little vb/vb.net application to check[/color]
    every[color=blue]
    >15 minutes if a record or certain records have changed in
    >a specific table, If record/records have changed then[/color]
    get[color=blue]
    >the index of that record. What is the best way to
    >accomplish this task? Any ideas or source code samples
    >would be highly appreciated.
    >
    >I am using vb.net with SQL Server 2000, vb6 is also
    >available to me.
    >
    >
    >Thanks
    >.
    >[/color]
  • Mo Quamar

    #2
    SQL Server's Data Change Notification

    [color=blue]
    >-----Original Message-----
    >Well, there are a couple ways you could do that.
    >
    >You could write a windows service with a
    >System.Timers. Timer object, that fires an event ever 15
    >minutes. Or, you could use a trigger on the table you are
    >evaluating. On update for your table, your trigger fires
    >executing a piece of code that could be a SQL job, or an
    >actual executable you had written in VB or VB.net. The
    >easiest programatic way would probably be the service
    >though.
    >
    >Cheers...
    >
    >[color=green]
    >>-----Original Message-----
    >>I am writing a little vb/vb.net application to check[/color]
    >every[color=green]
    >>15 minutes if a record or certain records have changed[/color][/color]
    in[color=blue][color=green]
    >>a specific table, If record/records have changed then[/color]
    >get[color=green]
    >>the index of that record. What is the best way to
    >>accomplish this task? Any ideas or source code samples
    >>would be highly appreciated.
    >>
    >>I am using vb.net with SQL Server 2000, vb6 is also
    >>available to me.
    >>
    >>
    >>Thanks
    >>.
    >>[/color]
    >.
    >Thanks for you reply.[/color]
    Yes, I am writing this process using Windows Servce and
    using Update Trigger, how do I know which record has
    changes?

    Comment

    • Alexander

      #3
      Re: SQL Server's Data Change Notification

      The most easy way is to create a table and inset in it a record index and
      change time on trigger event.
      Then your service can red this table and empty it, or keep it and just
      select after particuar time.

      Code can look like:
      CREATE TRIGGER watchTrigger
      ON <table_name, sysname, pubs.dbo.sales>
      FOR INSERT, UPDATE
      AS
      BEGIN
      insert watchTable ([ID], ChangeTime) select [ID], getdate() from inserted
      END
      GO
      "Mo Quamar" <mquamar@cprk.c om> wrote in message
      news:037e01c345 93$c41b7a30$a50 1280a@phx.gbl.. .[color=blue]
      >[color=green]
      > >-----Original Message-----
      > >Well, there are a couple ways you could do that.
      > >
      > >You could write a windows service with a
      > >System.Timers. Timer object, that fires an event ever 15
      > >minutes. Or, you could use a trigger on the table you are
      > >evaluating. On update for your table, your trigger fires
      > >executing a piece of code that could be a SQL job, or an
      > >actual executable you had written in VB or VB.net. The
      > >easiest programatic way would probably be the service
      > >though.
      > >
      > >Cheers...
      > >
      > >[color=darkred]
      > >>-----Original Message-----
      > >>I am writing a little vb/vb.net application to check[/color]
      > >every[color=darkred]
      > >>15 minutes if a record or certain records have changed[/color][/color]
      > in[color=green][color=darkred]
      > >>a specific table, If record/records have changed then[/color]
      > >get[color=darkred]
      > >>the index of that record. What is the best way to
      > >>accomplish this task? Any ideas or source code samples
      > >>would be highly appreciated.
      > >>
      > >>I am using vb.net with SQL Server 2000, vb6 is also
      > >>available to me.
      > >>
      > >>
      > >>Thanks
      > >>.
      > >>[/color]
      > >.
      > >Thanks for you reply.[/color]
      > Yes, I am writing this process using Windows Servce and
      > using Update Trigger, how do I know which record has
      > changes?[/color]


      Comment

      Working...