Solved

JavaScript to sense when a record has been updated in MSSQL

Posted on 2014-07-30
4
201 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 110

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 53

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

729 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