I’m creating an application that notifies users if a new row has been added to a table in the applications database. Would it be best to create a trigger for this or just check every few seconds directly from the application? Thoughts?
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.
Use Query Notifications. This is the SQL Server feature that allow notifications to be actively pushed to the client when data was changed by other user. It is better known as SqlDependency. You subscribe a query and you get notified when the result set has changed (rows were added, deleted or modified).
Eg. using a LinqToCache query and reacting to a invalidation notification: