RIOSmx
asked on
get a URL from a stored procedure
Hello there, I want to trigger a URL call from a stored procedure...
something like this..
//stored procedure
select * user where deleteaction=1
while not eof
geturl("http://www.servername.com/deleteuser.asp?user="& rs("user"))
end
//end
hope you can help, I really need your help so I am giving 500 points , tnx!
are you meaning to return the url as an output of the stored proc or to actually run the url?
ASKER
I just want to "run" the url, so that some action is taken o that externall site... need no output from the stored procedure other than success or failure
Hi RIOSmx!
Try this!
<%while not rs.eof%>
<script>
window.open("http://www.servername.com/deleteuser.asp?user="& rs("user"))
</script>
<%wend%>
Try this!
<%while not rs.eof%>
<script>
window.open("http://www.servername.com/deleteuser.asp?user="& rs("user"))
</script>
<%wend%>
Consider posting in a more appropriate Topic Area, such as:
https://www.experts-exchange.com/Web/Web_Languages/ASP/
https://www.experts-exchange.com/Web/Web_Languages/ASP/
ASKER
Sorry, I need to do this inside a STORED PROCEDURE , T-SQL language... not with ASP
if you run a stored proc it runs at the server, so you want the server to open a web page at its end? and do what with it? unless I'm working on the server i wont see it.
What happens if the sp is called more than once? lots of brouser windows all showing the same page?
What is this page supposed to do?
Maybe you could replicate the functionality of the web page somewhere else
ASKER
Ok, let me explain better... Server A contains SQL 2005, Server B is a web server on any king...
I want to trigger a URL call from Server A to Server B using a stored procedure, any consideration for security, multiple triggering or else will be done be me. I just need to know how can I GET an URL from inside a stored procedure to any web page outside the box.
So @ Server A inside a Stored Procudure I will have a code as follows, I will not show T-SQL here its just an example...
//begin
select * user where deleteaction=1
while not eof
geturl("http://www.servername.com/deleteuser.asp?user="& rs("user"))
end
//end
Server B with domain (servername.com) will accept that URL call and do something about it...ill take care of that
geturl() function shown at the Stored Procedure on Server A should be able to call that URL I guess using XMLHTTP o WinHTTP, I dont know the syntaxt of how to use either inside a Stored Procedure (T-SQL) , that what I need..
Thanks!
getURL() Returns the URL that is used to connect to the data source.
you cant 'push' a page out from sql
the only way I can think of doing this would be to run your code from an asp page
ask the SQL server to supply the url sure but the asp page will then request the page you want to see and display it.
you cant 'push' a page out from sql
the only way I can think of doing this would be to run your code from an asp page
ask the SQL server to supply the url sure but the asp page will then request the page you want to see and display it.
ASKER
I really dont need to display what comes out of that url, I just need to access that URL so that the server on the other end run a command..
Take a look at the thread in the url i am posting, I think it is all there but it is more complicated than what i need i am not really good a t-sql so I woudnt know how to do it simplier to my needs.. hope someone can help me out..
https://www.experts-exchange.com/questions/20590344/Need-a-Stored-Procedure-which-gets-XML-data-from-a-URL-and-inserts-it-into-a-table.html?query=get+url&topics=42
I dont understand what that has to do with your question unless I totally missunderstood what you wanted.
the thread you pointed is to get data into sql from a web page
what you have asked is to do is to load a web page from sql
If I've missunderstood what you are trying to do please tell me.
give me some background. that is the page supposed to do?
the thread you pointed is to get data into sql from a web page
what you have asked is to do is to load a web page from sql
If I've missunderstood what you are trying to do please tell me.
give me some background. that is the page supposed to do?
ASKER
Thank you I solved this on my own taking reference in the thread en my last post. I was pretty simple, just needed to OPEN a URL from a StoredProcedure, by OPEN I mean just view it wihtout displaying it just so the the web server on the other part could read son variables via GET in the URL.. tnx for your help anyways..
Great! Now please close the question. See here from the EE Help:
I answered my question myself. What do I do?
https://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi70
I answered my question myself. What do I do?
https://www.experts-exchange.com/Databases/Microsoft_SQL_Server/help.jsp#hi70
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.