?
Solved

Better approach or alternative to SqlDependency

Posted on 2009-04-22
1
Medium Priority
?
2,787 Views
Last Modified: 2012-05-06
I used this tutorial to setup database syncing:

http://support.microsoft.com/kb/555893

Basically the way it works is bind a notification to a query, run the query. Then when a change is made, the SQLDependency is disposed of, a new SQLDependency is created (apparently because a notification expires after one trigger is sent), then the query has to rerun.

This seems rather inefficient because if you have a 100,000 rows, and one row is changed, then you end up receiving all 100,000 rows again, rather than the one row that changed. Furthermore, to change data displayed (unless you want to rebuild the list view which doesn't look clean) you need to walk through your new data to find the differences and update them manually. I am setting up an updated datetime column so that I could walk through the new table quicker and skip rows with old timestamps. Still not ideal...

There must be a better way to go about this, right?
0
Comment
Question by:dcollins2010
1 Comment
 
LVL 46

Accepted Solution

by:
tbsgadi earned 2000 total points
ID: 24212425
Hi dcollins2010,

Have a look at the following:
http://www.15seconds.com/Issue/060223.htm

Good Luck!

Gary
1

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

755 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question