tags:

views:

140

answers:

1

Is it possible to grab a file using T-SQL via HTTP? I'm familiar with grabbing a file via FTP using a script and xp_cmdshell. I want to do the same thing except the file is only available via HTTP.

My guess is that it's not possible. If not, what are some alternatives? wget for Windows?

My goal is to get the file onto the SQL server then BULK INSERT it into a table. Like I said, I can do this with FTP without an issue.

Edit: Server version is only SQL 2000.

+1  A: 
  • You can use a VBScript file to replace wget for windows. Found a simple script file on this page.

  • If you use SQL Server 2005 or newer you can easily write a .NET function that can be called from T-SQL

dereli
Thanks. I don't know why I didn't think of VBScript.
Brad
By the way, that script does not work, however the one here does... http://blog.netnerds.net/2007/01/vbscript-download-and-save-a-binary-file/
Brad