Author |
Topic |
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2008-02-29 : 01:46:24
|
Can i execute a URL in tsql stored procedure.Waht i want's is to hit a url on some event.I know i can do it in CLR stored procedure but for that i have to deploy assembly on the server which i want's to avoid.Is there any way i can hit a url from tsql stored procedureKamran ShahidSr. Software Engineer(MCSD.Net)www.netprosys.com |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-29 : 02:40:10
|
You would you?The URL is parsed on server side and thus opens your web browser on the server, not your client machine.This will make it hard for you to read the requested page. E 12°55'05.25"N 56°04'39.16" |
|
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2008-02-29 : 03:13:46
|
I just want's to hit the url [no response is required]On the page where i am hitting there is some code which will executeKamran ShahidSr. Software Engineer(MCSD.Net)www.netprosys.com |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-29 : 03:16:51
|
Ok. Use xp_cmdshell stored procedureexec master..xp_cmd_shell 'www.sqlteam.com' E 12°55'05.25"N 56°04'39.16" |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-02-29 : 03:20:46
|
[code]exec master..xp_cmdshell 'c:\progra~1\intern~1\iexplore.exe www.sqlteam.com'[/code]Change the path to iexplore.exe as per your machine setup.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
kamii47
Constraint Violating Yak Guru
353 Posts |
Posted - 2008-02-29 : 04:24:03
|
Thanks all specially HarshHarsh Can some how i can get path 'c:\progra~1\intern~1\iexplore.exe'automatically? [From some function or any thing]Kamran ShahidSr. Software Engineer(MCSD.Net)www.netprosys.com |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-29 : 05:27:10
|
[code]DECLARE @Path NVARCHAR(256)EXEC master..xp_regread 'HKEY_CLASSES_ROOT', 'htmlfile\shell\open\command', NULL, @Path OUTPUTSELECT @Path = @Path + ' www.sqlteam.com'select @path--exec master..xp_cmdshell @Path[/code] E 12°55'05.25"N 56°04'39.16" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-02-29 : 05:51:35
|
quote: Originally posted by Peso
DECLARE @Path NVARCHAR(256)EXEC master..xp_regread 'HKEY_CLASSES_ROOT', 'htmlfile\shell\open\command', NULL, @Path OUTPUTSELECT @Path = @Path + ' www.sqlteam.com'select @path--exec master..xp_cmdshell @Path E 12°55'05.25"N 56°04'39.16"
Not sure why it runs for minutesMadhivananFailing to plan is Planning to fail |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-29 : 06:05:43
|
Me neither. I told OP this is a bad idea.When copy the @Path content and paste it to Start -> Run, it works. E 12°55'05.25"N 56°04'39.16" |
|
|
|