Solved

Service and database table

Posted on 2009-04-03
4
140 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Suggested Solutions

Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
Never store passwords in plain text or just their hash: it seems a no-brainier, but there are still plenty of people doing that. I present the why and how on this subject, offering my own real life solution that you can implement right away, bringin…
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…

860 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