简体   繁体   中英

Webservice for Watching a Table in SQL server and populating it

Can we write a web service to watch a table in sql server. whenever the corresponding table is populated with new records, the new records should appended to the another table which has the same structure of the old one.

Is this is possible using webservices if not how to perform this.

Yes, but webservice will be just fetching results of your modification.. I don't thing it will ever monitor your table changes. To monitor table changes you can use trigger on different actions that is performed on the table and stored in another table. Your web service will just read these updates and provide you the details.

You can definitely quite easily publish the contents of a table in SQL Server to the web - eg using WCF Data Services .

But you cannot have the webservice "push" the changes to its clients, eg the webservice cannot detect changes and then notify the clients. The clients have to come and ask the web service for the data ("pull" model).

If you need to be able to notify clients of changes, you might be better off posting a message onto a message queue (like MSMQ ) and have the clients who are interested in that data notification listen on that queue for new messages to show up.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM