Solved

JavaScript to sense when a record has been updated in MSSQL

Posted on 2014-07-30
4
181 Views
Last Modified: 2014-08-01
Hello,

I'm looking for a script to sense when a record in an MSSQL DB has been updated, to then refresh the page.  I am trying to avoid using a timer and was wondering if there is a way to do this...?

Thanks in advance!
0
Comment
Question by:Nico2011
4 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 250 total points
ID: 40229019
To understand what is going on here, you need to understand the nature of the client/server protocol.  This article should help you get that part.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/A_11271-Understanding-Client-Server-Protocols-and-Web-Applications.html

Executive summary: Only the client can make a request; the server cannot initiate the communication.  You almost certainly need to use a timer to drive AJAX requests to a script on the server that can sense the condition you want to detect.
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 250 total points
ID: 40229065
This is something I have looked at myself and not implemented.  This example shows how this can work with node.js and azzure but you can substitute for your own db  http://azure.microsoft.com/en-us/documentation/articles/sql-database-nodejs-how-to-use/
0
 

Author Closing Comment

by:Nico2011
ID: 40234186
Thank you both - both were correct and pointed me in the right direction, so I shared the points!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 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

9 Experts available now in Live!

Get 1:1 Help Now