July 1, 2014 at 5:19 am
Hi Experts,
I have a SP and can export the data to a .csv file, however I want the .csv file's name to be in month and date format whenever I run the SP or execute a job
Thanks,
Ashif Shaikh:-)
July 1, 2014 at 5:32 am
Could you give an example?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
July 1, 2014 at 5:38 am
Hi,,
I am running the SP thorugh a SQL Agent job, as when the job runs it creates a file on H drive of the server. However every time it overwrites the .csv file with the same name ie 'new_file.csv' and I need it in this format 'new_file_2014061.csv', so that when it runs it should create a new file..
The jobs runs only once a month.
July 1, 2014 at 5:45 am
I guess you can just adapt the code that creates the file.
Is it located in the sp?
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
July 1, 2014 at 6:01 am
no, for me the jobs is creating the output file from job- step -> advance -> output
July 1, 2014 at 7:12 am
Ashif Shaikh (7/1/2014)
no, for me the jobs is creating the output file from job- step -> advance -> output
Ah yes, you need to use jobtokens for that.
Example:
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
July 1, 2014 at 7:21 am
Koen Verbeeck (7/1/2014)
Ashif Shaikh (7/1/2014)
no, for me the jobs is creating the output file from job- step -> advance -> outputAh yes, you need to use jobtokens for that.
Example:
Or if you only want YYYYMM then you could add a step and use ActiveX Script with Scripting.FileSystemObject to rename/copy the file
Far away is close at hand in the images of elsewhere.
Anon.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply