sql-serverlisten

SQL Server - how to listen for table changes


In PostgreSQL, I can add a trigger that performs

PERFORM pg_notify('table', 'some data');

to all clients that have performed

LISTEN table;

Is it possible to do something like that in SQL Server?


Solution

  • In the end I used SqlTableDependency (Github link) which effectively removes the necessity for writing additional code in the .NET application.