?
Solved

SQL Trigger to HTTP POST

Posted on 2005-03-19
7
Medium Priority
?
207 Views
Last Modified: 2008-03-17
I need to write a MS SQL 2000 Db trigger to do the following but I am new to SQL and have very little experience...

What I need to do is on the insert of any data to a table called docs I need to check the Name of the document contains a certain string of characters e.g Council Minutes etc etc
If it does then i need to extract some further info from a series of fields Folder,Leaf, and a binary field which actually contains the document.
I then need to send these to an HTTP server via an HTTP POST command.

Any thoughts greatly appreciated as I know nothing about this
0
Comment
Question by:richarddanks
[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
  • 3
  • 3
7 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 13582838
A trigger can return a result set...I am unfamiliar with the HTTP POST command however
0
 

Author Comment

by:richarddanks
ID: 13582887
sorry I think that I need to add the result to a set of variables then send out the sesults in the format of an http post url

e.g. http://serverfqdn.com/docname=12&Leaf=folder etc etc
thenks for the comment though
0
 

Author Comment

by:richarddanks
ID: 13582928
So Far Ithink what I need is

CREATE TRIGGER tr_agendapost
ON docs
FOR INSERT
AS
DEFINE @docname varchar(256)
DEFINE @leafname varchar(256)
DEFINE @document bin(1024)

SELECT @docname=docname FROM inserted
WHERE docname LIKE ('council%')

but I'm not sure this will a) give me the desired results or b) where to go from here to get the results in to a set of variables and then push those results to a webserver...

0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 

Author Comment

by:richarddanks
ID: 13582934
Also this needs to process multiple INSERTS to the DB
0
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 13583037
CREATE TRIGGER tr_agendapost
ON docs
AFTER INSERT
AS
BEGIN
IF inserted.docname LIKE ('council%')
     SELECT docname, leafname, document FROM inserted
END
0
 
LVL 34

Accepted Solution

by:
Brian Crowe earned 1500 total points
ID: 13583043
correction...

CREATE TRIGGER tr_agendapost
ON docs
AFTER INSERT
AS
BEGIN
IF EXISTS (SELECT * FROM inserted WHERE docname LIKE ('council%'))
     SELECT docname, leafname, document FROM inserted
END
0

Featured Post

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

771 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