Click here to Skip to main content
14,329,523 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello, experts..

I'm developing a database application by C# in which users can contact to the SQLServer 2008 (installed on a server dedicated for SQLServer 2008) over small lan Network. The users send and retrieve their data from the database in a normal way. Some users' tasks depend on some data that must be entered by another users. So, my question is:
When users send their entered data to the SQL database, is there a way to make SQL database itself automatically send updates to the meant users who need to know these information?
For example, when a user1 entered new customer data, and send these data to the SQL database, thus SQL database itself automatically send updates to user4, user6, user10 computers (just the meant users)..
Is this possible? and how?
Thanks for helping..

What I have tried:

Really, I don't know how to do it..
Posted
Updated 28-Jul-19 8:34am
Comments
Richard Deeming 26-Jul-19 9:25am
   
NB: Support for SQL 2008 and 2008 R2 ended in July 2014. They'll continue to work, but you won't get any bug fixes or security updates. You also won't be able to install them on an up-to-date server OS, so you're also going to be missing security patches for your server.

Hopefully your database server is behind a firewall with extremely limited access. You will need to evaluate the potential security risks compared to the cost of upgrading to a supported version of SQL.
Rate this:
Please Sign up or sign in to vote.

Solution 1

I guess you will want to start with SQL Triggers......
SQL Server Triggers Tutorial[^]

They perform actions when a specific event happens on the database. In this instance when a user enters data, the trigger rule would fire and do whatever you need to do.
   
Comments
Benktesh Sharma 26-Jul-19 11:50am
   
As mentioned above, a trigger could be a stored procedure to send email. Example here - https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-send-dbmail-transact-sql?view=sql-server-2017
Rate this:
Please Sign up or sign in to vote.

Solution 2

Before figuring out "how", you need to figure out "how often" and "what" it is that these "users" need to "see".

Only then can you start thinking about "push OR pull" technologies, if at all.
   
Rate this:
Please Sign up or sign in to vote.

Solution 3

If it were me I would maintain a list of who needs to be notified and what updates they need to be made aware of and in the c# method that updates the db I would generate and send the the email there. I would not try to do it in SQL server.
   
Rate this:
Please Sign up or sign in to vote.

Solution 4

I would agree with RmcbainTheThird. This sounds more of a job for messaging middleware. Sure, the Sql Server is involved by storing the data, but it really doesn't have the tools to send notifications to other users on other computers without a lot more work. But put up an ASP.NET MVC web app that ties in to the database, your users can retrieve their data from the web app (much safer for your data than SSMS) and you can push notifications of the state changes in the database to users as they log in to the app. Tie this together with Slack integration or email relay and you can communicate directly with the user regardless of their location or device.
   
Rate this:
Please Sign up or sign in to vote.

Solution 5

Thanks so much for your responses, friends. The solution presented by AFell2 is the closest to be executed, although it's somewhat difficult and it needs a lot of work..
Again, thank you so much..
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100