Click here to Skip to main content
15,901,970 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a database db1 which has its own application developed with c#. There are several other applications, which each has its own database. These other applications store data in their own databases and record some documents in db1 using a stored procedure created in db1. The user of the db1 application needs to accept the document stored by the other application/database; when he accepts it, automatically some CRUD actions are performed in the database of the application that stored the document in db1. Db1 needs not to be aware of the other applications but the other way round because it is improper to modify db1 when new applications are developed in future. My question is how do I perform these CRUD actions automatically?: I was thinking of 1. Creating a job in mssql to perform that; when new applications are developed, a job is created for it to fetch the status of its document then perform the action in its database.
2. Creating windows service application for each of the applications, which periodically checks the status of the document it stored in db1, then perform the CRUD actions- this service will run on the server.
3. Creating a single windows service, which fetches the status of all documents, the perform CRUD actions on list of databases. When new applications are developed, their database is added to the list.

Any other suggestions are welcomed.

What I have tried:

I don’t know which option to choose: which is best
Posted
Updated 17-Jan-18 1:23am
Comments
Dotnet_Dotnet 17-Jan-18 6:59am    
insted of application sir you can developed dll.

1 solution

I am thinking on this approach

1) You must be submitting the documents in some table on DB1
2) Add extra fields to store the DB server details where the document is coming from (other applications)
3) Write task in DB1 server to add remote server in DB1
Read here about remote server and why we need it
View or Configure Remote Server Connection Options (SQL Server) | Microsoft Docs[^]

4) Add trigger in DB1 document table to look for newly accepted document and then accordingly run the CRUD operations on other database using the remote server connection
 
Share this answer
 
Comments
kwaku Emma 19-Jan-18 13:38pm    
Thanks for your suggestions. I have problem with point 4: "Add trigger in DB1..."
that means if any new software is written to insert documents in DB1, the trigger has to be modified? I think it is improper to do that. ...What do you think?
RDBurmon 22-Jan-18 1:19am    
No need to modify the trigger and that's why we are storing details in extra field (point #2), you need to write that trigger which will run the CRUD on the database using the connection details mentioned in that extra field, of course you need remote database connection and that's why we are adding remote server connection (point # 3)

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900