Better approach or alternative to SqlDependency

Posted on 2009-04-22
Last Modified: 2012-05-06
I used this tutorial to setup database syncing:

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?
Question by:dcollins2010
    1 Comment
    LVL 46

    Accepted Solution

    Hi dcollins2010,

    Have a look at the following:

    Good Luck!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This is my first ever Article on EE or elsewhere; therefore, please bear with me if I have some discrepancies in my writing. I read many articles and questions related to "how to pass values to SSIS packages at run-time?"  Hence, this common ques…
    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now