Skip to content

A solution that enables to track database tables changes and notify the subscribers. Can be used in caching middle ware to invalidate the cache etc

Notifications You must be signed in to change notification settings

RahmanM/SQLChangeTrackingService

Repository files navigation

SQL tracking solution that can be used in middleware caching invalidation. This enables:

  • A windows service that is continiously polling for SQL change trackings
  • Enables the clients to subscribe for a specific table
  • Notifies the clients when change happens
  • Enables the clients to unsubscribe if needed

To test:

  1. Create the sample database (e.g. use SampleDatabaseAndTables.sql) or use your own database
  2. Configure the database and the tables for change tracking e.g.

ALTER DATABASE SQLChangeTrackingTest
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON) GO

ALTER TABLE Customer ENABLE CHANGE_TRACKING
WITH (TRACK_COLUMNS_UPDATED = ON)

ALTER TABLE Employee ENABLE CHANGE_TRACKING
WITH (TRACK_COLUMNS_UPDATED = ON)

  1. Create the required table and stored procedures requried by this application e.g. Run the Tables.sql and StoredProcedures.sql files

  2. Run the Sql.ChangeTracking.WindowsService project in debug mode

  3. Run the Sql.ChangeTracking.Client project in debug mode

  4. Do a change into table Customer e.g. UPDATE Customer SET FirstName = 'Rahman' where Customer.FirstName = 'rahman'

The client should get notification about this change!

About

A solution that enables to track database tables changes and notify the subscribers. Can be used in caching middle ware to invalidate the cache etc

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published