question

rmk_mano avatar image
rmk_mano asked

I need to rename a file

i'm generating a CSV file using some exe. Output will be say : abcd.csv i need to write a step to rename the file as below ABCD_acbd_DDMMYYYY.CSV --> ddmmyyyy should be auto generated(the day i run the report(getadte())) please help me on this
mssql
4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Magnus Ahlkvist avatar image Magnus Ahlkvist commented ·
But from where are you calling the exe-file? From T-SQL-code in SQL Server, from an SSIS-package, from the command prompt, from a scheduled job in Windows etc? Renaming a file on the format you specify is not very complicated, but to give an example requires to know if it is to be done from a T-SQL procedure etc.
2 Likes 2 ·
Magnus Ahlkvist avatar image Magnus Ahlkvist commented ·
Are you calling the .exe from SQL-code, from an SSIS-package, from a scheduled Windows job etc?
0 Likes 0 ·
rmk_mano avatar image rmk_mano commented ·
i call the exe with a unique name. and the relevant entries are there in the table. e.g : xxx.exe test test is the unique name and the file name, path, sql query everything will be in a table
0 Likes 0 ·
rmk_mano avatar image rmk_mano commented ·
the file name is the standard one.. so once i pick the file from the location i need to append the date (DDMMYYYY) to the file and sent ... got my point ?
0 Likes 0 ·

1 Answer

·
sandman147 avatar image
sandman147 answered
can you concatenate CURRENT_TIMESTAMP to your csv
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.