How to fire a function in C# once data changes on SQL Server Table only when the table gets stable?

Viewed 197

Scenario

  • I have a database where real-time data is inserted. Ex. Price of Symbols.
  • The data is inserted every 5 sec.(around 10000 rows each time) though some 3rd party tool

Things I have already tried:

  • SQL Dependency which detects changes in the table and alerts me the changes are made.
  • On change I fire fetching query
  • Problem arises is that the connection pool gets full and throws a exception
  • Thread sleep will be a problem since if rows insertion takes less time , still I will be waiting for fixed interval

What I want:

  • My Web application to fetch the data once insertion gets stable i.e no more rows are inserted in a time-span of 1-2 sec.

Environment C#-MCV, SQL Server

0 Answers
Related