When using SqlDependency & OnChangeEventHandler in .Net with SQL Server, is it possible (simple?) to discover what data has changed?
When using SqlDependency & OnChangeEventHandler in .Net with SQL Server, is it possible (simple?)
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to run the query again and compare the result obtained with the previous result. How simple it is to detect exactly what changed, depends on what exactly you SELECTed (a single row, all rows in a table, a subset of rows, an aggregate on some/all rows, a join between several tables etc etc). But in general is not simple at all, and is always best to simply run the entire query again, discarding the previous result.
Think at Query Notifications as a means to actively invalidate caches, not as a mean to track changes.