I have a txt file that is constantly being produced via an "export to txt" command using sqlcmd from the command prompt. This txt file is generated everyday based on a SQL script to retrieve records from our Microsoft SQL Server 2008 database. We need to upload each txt file to an FTP site with a specific naming convention. I want to know how to change the name of the txt file to THAT specific naming convention automatically via one method everyday.
The convention is as follows:
where the CCCCC represents a static value (which is my company's name)
the 2012 is the current year...which also could be static ... until the year changes of course
the Julian date (three digit number)
and the 01 is also a static constant
APPLE+2012+JULIANDATE+01. The + just means its all concatenated together.
The txt file is exported with some arbitrary value lets say : 123456.txt but we want itt ---> APPLE201236501.txt. for example.
If our batch is running on a job everyday to produce this txt file... how could we set up another automation to rename it once it's created to that naming convention?