Solved

Service and database table

Posted on 2009-04-03
4
141 Views
Last Modified: 2012-05-06
I have a sql server 2005 database and I want to keep track of 1 table with 3 fields (Number, Name, Status) in it. For example is a record is inserted into this table with a status of 1 then I want to generate a xml based on the information for that record in the table. If the status is other than 1 I do not need to worry about it. I have heard I would probably need to develop a vb service to do this, any thoughts or suggestions would be very helpful. Also any ideas requireing code would have to be in vb.net 2005. Again I thank you for any help offered in advance.
0
Comment
Question by:lothos123452000
  • 2
  • 2
4 Comments
 
LVL 11

Expert Comment

by:CraigYellick
ID: 24065544
A trigger will handle the part about "when a record is inserted". The FOR XML clause will handle the creation of an XML document based on the inserted record. Neither of these require a service.

What do you want to do with the XML document once it is created? That might require a service but more likely a CLR procedure with appropriate permissions can do just about anything.
0
 

Author Comment

by:lothos123452000
ID: 24069151
Once the xml is created I need to post it, using https: to a third party who is initially inserting the record to let them know it was inserted successfully. Perhaps your right a CLR would do the trick, but would I just create a job on the sql server to run the clr every minute or did you have something else in mind.
0
 
LVL 11

Accepted Solution

by:
CraigYellick earned 500 total points
ID: 24069339
Depends how often this event will happen. A CLR trigger procedure could do the whole thing, but could be a problem if there are many inserts and the targer HTTPS server responds slowly or is down.  For the long term you are right, it would be best to batch this up with a process that can handle a large number of inserts and be separate from sending the acknowledgement.

Rather than reacting to the insert you could have a flag in the table that defaults to indicating the need to be processed. When the SQL job runs it looks for the flag and processes records.  You could still use a CLR procedure to keep this all inside SQL Server and not be dependent on outside services. If you ever move the database to another server it will move along with it.

0
 

Author Closing Comment

by:lothos123452000
ID: 31566455
Thanks for the suggestions and the help I appreciate it.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question