Solved

JavaScript to sense when a record has been updated in MSSQL

Posted on 2014-07-30
4
195 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article discusses how to implement server side field validation and display customized error messages to the client.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

734 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