Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to Execute an URL from SQL server 2008

Author  Topic 

navbingo20
Starting Member

12 Posts

Posted - 2014-12-16 : 08:12:30
Hi Team,

i need to execute an URL from a stored procedure. I will create a job to execute the SP at the end-of-day everyday..

my url will be like this:

https://app.abcd.com/psa/api.do?function=create-task-updates&data=%3cdata%3e%0d%0a%3citem%3e%0d%0a%3ccreator_id%3e258676%3c%2fcreator_id%3e+%0d%0a%3cdate%3e2014-12-16%3c%2fdate%3e%0d%0a%3ctask_id%3e5755158%3c%2ftask_id%3e%0d%0a%3cactual_start%3e2014-12-18T02%3a13%3a00%3c%2factual_start%3e%0d%0a%3ctime_code_id%3eDefault%3c%2ftime_code_id%3e%0d%0a%3chours_worked%3e4.5%3c%2fhours_worked%3e%0d%0a%3ccomments%3eAm+half+way+there+Navin+on+16%2f12%2f2014+%40+6.05+pm%3c%2fcomments%3e%0d%0a%3c%2fitem%3e%0d%0a%3c%2fdata%3e%0d%0a&token=d8

please help me out to resolve this issue or guide how to proceed further

Thanks
Navin

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2014-12-16 : 08:36:30
you can have 2 steps in the job.
step1:will execute the procedure
step2:call the URL using cmdexec
something like this
"C:\Program Files (x86)\Internet Explorer\iexplore.exe" "
https://app.abcd.com/psa/api.do?function=create-task-updates&data=%3cdata%3e%0d%0a%3citem%3e%0d%0a%3ccreator_id%3e258676%3c%2fcreator_id%3e+%0d%0a%3cdate%3e2014-12-16%3c%2fdate%3e%0d%0a%3ctask_id%3e5755158%3c%2ftask_id%3e%0d%0a%3cactual_start%3e2014-12-18T02%3a13%3a00%3c%2factual_start%3e%0d%0a%3ctime_code_id%3eDefault%3c%2ftime_code_id%3e%0d%0a%3chours_worked%3e4.5%3c%2fhours_worked%3e%0d%0a%3ccomments%3eAm+half+way+there+Navin+on+16%2f12%2f2014+%40+6.05+pm%3c%2fcomments%3e%0d%0a%3c%2fitem%3e%0d%0a%3c%2fdata%3e%0d%0a&token=d8"

Javeed Ahmed
https://www.linkedin.com/pub/javeed-ahmed/25/5b/95
Go to Top of Page

navbingo20
Starting Member

12 Posts

Posted - 2014-12-16 : 08:52:38
Hi Team,

i referred this below link

http://blog.davebouwman.com/2008/07/09/call-geonames-web-services-from-a-sql-stored-procedure/

it sorted out my issue..

Thanks all for your support
Go to Top of Page
   

- Advertisement -