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
 SSIS and Import/Export (2008)
 HTTP Connection dynamic url

Author  Topic 

murrayb3024
Yak Posting Veteran

79 Posts

Posted - 2012-10-19 : 10:23:10
Using an HTTP connection manager and there is a url of a site and the url changes based on date. This is last months url:

https://awebsite.com/downloadables/2012/file1209.zip

Here is this months:

https://awebsite.com/downloadables/2012/file1210.zip

I need to set it up so the following bold items change based on the date of the month and year:

https://awebsite.com/downloadables/2012/file1209.zip

Any ideas? Is there a better way to do this? The endgame is to automate this process.

Thanks

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-10-19 : 12:25:13
You can use an expression such as shown below to construct the URL. You would replace the GETDATE() with the column name or variable that holds the date of interest to you.
SELECT 
'https://awebsite.com/downloadables/'
+ CONVERT(CHAR(4),GETDATE(),112)
+'/file'
+ RIGHT(CONVERT(CHAR(8),GETDATE(),112),4)
+'.zip'
Go to Top of Page

murrayb3024
Yak Posting Veteran

79 Posts

Posted - 2012-10-19 : 12:28:57
Thank you
Go to Top of Page
   

- Advertisement -