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
 General SQL Server Forums
 New to SQL Server Programming
 Hit the URL

Author  Topic 

WoodHouse
Posting Yak Master

211 Posts

Posted - 2012-07-30 : 19:09:47
Hi Guys,

Just want to hit the URL like open & close(SSIS or T-sql).

This is dashboard URL..Once I hit the URL and the dashboard data will get refreshed..

Please help on it..

Thanks a Lot

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-30 : 19:26:00
You'll probably want to post your question on a programming site since your question is in regards to programming and not SQL Server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

WoodHouse
Posting Yak Master

211 Posts

Posted - 2012-07-30 : 19:31:47
Thanks tkizer,

Please advise the below code will work for my requirement?
I got this code from SQLTeam forum(wrote by peso I think)

declare @object int
declare @return int
declare @valid int
set @valid = 0

--create the XMLHTTP object
exec @return = sp_oacreate 'Microsoft.XMLHTTP', @object output
if @return = 0
begin

--Open the connection
exec @return = sp_oamethod @object, 'open("GET","URLname", false)'

if @return = 0
begin
--Send the request
exec @return = sp_oamethod @object, 'send()'
--PRINT @return
end

if @return = 0
begin
declare @output int
exec @return = sp_oamethod @object, 'status', @output output

if @output = 200
begin
set @valid = 1
end
end
end

--destroy the object
exec sp_oadestroy @object

if @valid = 1
print 'valid'
else
print 'invalid'
Go to Top of Page
   

- Advertisement -