JavaScript How to have node.js listen for new sqlsrv rows in a table

Is there a way to listen for new sqlsrv data in node.js (or PHP 5.5) without having to poll the database constantly? I am (obviously, I suppose) trying to have mssql notify my application when new data has been written without having to poll from JavaScript every few seconds.
I thought about something like:

(in a timer:)

SELECT TOP 1 row_id FROM table

if returned row_id > what I last saw, do something

but it seems inelegant... thank you in advance for any suggestions.

Answer:1

I know this is a somewhat nebulous question but which algorithm would be more efficient and/or "faster"? Searching through a preloaded JavaScript array of names or using the MySQL query "SELECT NAME ...

I know this is a somewhat nebulous question but which algorithm would be more efficient and/or "faster"? Searching through a preloaded JavaScript array of names or using the MySQL query "SELECT NAME ...

  1. what more efficient ac or dc
  2. what's more efficient than led
  3. what more efficient
  4. which is more efficient in converting biomass
  5. which is more efficient recursion or iteration
  6. which is more efficient otto or diesel

I have an angular project set up that when a user goes to /cloud and they aren't logged in (isLoggedIn() return fails), it redirect to /login. And then if they are logged in and go to /login it ...

I have an angular project set up that when a user goes to /cloud and they aren't logged in (isLoggedIn() return fails), it redirect to /login. And then if they are logged in and go to /login it ...

I want to set null value in onclick() event of textarea, But my code does not work properly.. <textarea id="txtwishlistsong1" rows="5" cols="70" runat="server" onclick="return ...

I want to set null value in onclick() event of textarea, But my code does not work properly.. <textarea id="txtwishlistsong1" rows="5" cols="70" runat="server" onclick="return ...

  1. null value text
  2. datagrip null value text
  3. null value in text file
  4. check null value text field javascript
  5. elasticsearch null_value text
  6. devexpress lookupedit null value text
  7. wpf combobox null value text
  8. replace null value with text in sql
  9. insert null value in text file

For some reason, every function i'm calling is not working. Either it is "fadeOut", "fadeIn" or "fadeTo", I am getting the error. Here is the js script code as well as the HTML. <html> &...

For some reason, every function i'm calling is not working. Either it is "fadeOut", "fadeIn" or "fadeTo", I am getting the error. Here is the js script code as well as the HTML. <html> &...