I have a 'C#' Application consuming a 'Sql Server 2012' database. I am using a Sql Dependancy
object to watch the changes in an important table, using Sql Server
Query Notification
technology. I am currently watching for the following query :
SELECT Creditor, Description, AccountNo, Date, ID
FROM [dbo].[Acc_R1392]
where AccountNo > 18000
and AccountType not in (1,2,5,7)
but this query result to a set of 10,000 (growing also) records, so each time a user DELETES, UPDATES or INSERTS (D/U/I) a record my application reads around 10,000 (growing also) records.
Briefly I want to detect changes on any records, so it won't help to filter last n records, on the other hand, it costs a lot to read all the records selected, is there somehow a way to detect D/U/I changes but read only the records which have been affected by the change?