# Watching a .mdf File

**URL:** <https://discourse.nodered.org/t/watching-a-mdf-file/56534>\
**Category:** General\
**Tags:** database\
**Created:** [12 January 2022 14:25 UTC](https://discourse.nodered.org/t/watching-a-mdf-file/56534 "2022-01-12T14:25:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diver/32/54073_2.png) [@Diver](https://discourse.nodered.org/u/Diver)\
**Post date:** [12 January 2022 14:25 UTC](https://discourse.nodered.org/t/watching-a-mdf-file/56534/1 "2022-01-12T14:25:01Z")

</div>

Hi there,

I am currently trying to keep an application updated about some MS SQL Server Databases, therefore I need to read the DB (using the mssql node), change some small things about the output and then send it to a Rest API. It doesn't really matter why I need to do this, the Question is:

I always want to resend Data that got changed, as soon as it got changed. I hoped this would work by adding a watcher to the directory containing the .mdf files, but sadly it doesn't work, where [these answers](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/b7db6744-cd7b-42b5-a84e-5e511a5e8e59/mdf-amp-ldf-files-last-modified-date-not-increasing-as-expected?forum=sqldisasterrecovery) give an explanation to. At least I think that the explanation of SQL Server bypassing the file-system which causes the watcher to not reccon the change sounds logical.

Does anyone know any solution to this? Is there a Node that maybe does trigger, when a .mdf File gets changed?  
The only solution I came up with was a Request every few seconds and then a filter only letting through messages, that differ from the previous one. But since the Databases can get pretty big, that's no acceptable solution.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [12 January 2022 14:39 UTC](https://discourse.nodered.org/t/watching-a-mdf-file/56534/2 "2022-01-12T14:39:47Z")

</div>

You could use a trigger and call a http endpoint.

E.g. "How to Fire a Web Request from Microsoft SQL Server" [How to Fire a Web Request from Microsoft SQL Server](https://www.botreetechnologies.com/blog/how-to-fire-a-web-request-from-microsoft-sql-server/)

---

<div class="post-metadata">

**Author:** ![Diver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/diver/32/54073_2.png) [@Diver](https://discourse.nodered.org/u/Diver)\
**Post date:** [13 January 2022 13:56 UTC](https://discourse.nodered.org/t/watching-a-mdf-file/56534/3 "2022-01-13T13:56:23Z")

</div>

It worked, thanks a lot!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 January 2022 13:56 UTC](https://discourse.nodered.org/t/watching-a-mdf-file/56534/4 "2022-01-27T13:56:31Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
