0

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?

Mahdi Tahsildari
  • 13,065
  • 14
  • 55
  • 94
  • I dont much abt Sql Dependancy but I'm wondering if using a trigger wont help to solve your requirement. – Bayeni Aug 19 '14 at 09:55
  • @Bayeni no trigger is not a good choice, triggers can play this role but you'll have a lot to implement yourself, while query notifications are ready meal. – Mahdi Tahsildari Aug 19 '14 at 11:08

0 Answers0