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.
| Author |
Topic |
|
soorma
Yak Posting Veteran
52 Posts |
Posted - 2009-08-26 : 17:19:32
|
| I have a server where client will FTP some leads everyday. I have to move these leads to a different server. The client will upload the leads with this naming convention YYYYMMDD_test.csvI have a SP that moves the leads. A dts package that will run everyday.SELECT @cmd='move \\servername\folder\folder\YYYYMMDD_test.csv \\servername\folder\folder\Export_test.csv'exec master.dbo.xp_cmdshell @cmdThe question i have how do i get the leads right file for everyday by there naming convention YYYYMMDD_test.csvIf they upload leads like20091126_test.csv for aug 26 200920091127_test.csv for aug 27 2009When i run the SP i need to get the correct csv file for that daySELECT @cmd='move \\servername\folder\folder\YYYYMMDD_test.csv \\servername\folder\folder\Export_test.csv'exec master.dbo.xp_cmdshell @cmd |
|
|
Bustaz Kool
Master Smack Fu Yak Hacker
1834 Posts |
Posted - 2009-08-26 : 20:16:47
|
| If you are trying to get "today's" file, you can get the date using GetDate() and compose your file name string using the DatePart function.HTH=======================================Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727) |
 |
|
|
soorma
Yak Posting Veteran
52 Posts |
Posted - 2009-08-28 : 12:47:41
|
Thanks quote: Originally posted by Bustaz Kool If you are trying to get "today's" file, you can get the date using GetDate() and compose your file name string using the DatePart function.HTH=======================================Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727)
|
 |
|
|
|
|
|