July 23, 2015 at 10:27 am
I have a file named abc-72015.txt.
I have a package that renames the file from abc.txt to abc-72015.txt
I want to do the reverse. I wan to rename it from abc-72015.txt to abc.txt.
I have a variable named myFileValue with a value of abc.txt.
Can I do this by setting the variable as an expressions and use a function to rename it as abc.txt?
What would the syntax be?
Do I need to anything else?
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 23, 2015 at 10:49 am
I tried the following but I got an error?
Substring( @[User::MyFileValue] ,1,3)
The variable User::MyFileValue was not found in the variables collection. The variable may not exist in the correct scope.
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 23, 2015 at 11:05 am
I used the following example to rename the file from abc.txt to abc-72015.tx:.
http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename.html
url]
I need to do the reverse:
abc-72015.txt to abc.txt
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
July 23, 2015 at 11:30 am
Quick thought, you can either do a copy/rename snd a delete with a file system task or a rename with a scipt task an file system objecr.
July 23, 2015 at 12:10 pm
I am using a File System Task.
The Package is located at the following URL
http://www.rafael-salas.com/2007/03/ssis-file-system-task-move-and-rename.html#comment-form
url]
I want to rename import20150723.txt to import.txt
For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/
For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy