Solved

Service and database table

Posted on 2009-04-03
4
142 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

739 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