In SSIS is it possible to rename a directory? There is a requirement like copy a directory and paste it in a different location and rename it with current date.
Yes, this is possible in SSIS using the File System Task.
For detail and step by step visit this link.
Related
I have a requirement of finding the recently modified/created file from a directory and rename it to a standard name run that file and then rename it back to previous name. How can this be achieved?
Steps needed to be achieved:
finding the recently modified/created file
rename that file to a standard name.
run that file
rename it back to previous name.
I used a script task to find the recent file, but i could not move forward. I tried many things. Any solution on how to implement this?
I used this blog to find the recently modified/created file - https://www.techbrothersit.com/2013/12/ssis-how-to-get-most-recent-file-from.html
I know only how to create one folder at a time in my Aptana web project. Can I create multipl folders at a time ? That is, create my project structure in one go ?
You can achieve this task by creating a
batch file or using ant files
For an example crate a skeleton of the folder structure in C:/skeleton and you can copy this structure to aptana's work space y running your batch/ant file
For batch file creation, refer the following link,
batch file
And for ant file creation, refer the following link,
ant file
I am facing a problem while deleting a file on a network location using SSIS, since its a zip file, contains monthly SQL Database backup file, so I need to delete the last month file before copying current month file.
May be there is some app which were using this file, I am not sure, but I wanna get rid of this file, so that I can copy new file.
Thanks
Use a file task and you should be able to delete pretty much anything on any location as long as you have the rights to do so.
in SSIS 2008, In my incremental process, I would like to create automatically a new folder containing the current date.
Then copy all files from a source directoty to this new folder...
Any idea how to do that?
Thanks in advance
Largo
You can use "Execute Process" to run a robocopy .bat file to copy the files.
Create a local variable and assign it in a C# script to get the current date.
Dts.Variables["User::CurrentDate"].Value = DateTime.Now;
Found a easier way to add the date. follow the link
http://www.sqlnerd.com/ssis_dynamic_dates.htm
I have a SQL server 2008 and I would change the name of the backup file.
I use an SSIS package to perform my backups.
The file's name looks like
[DATABASE_NAME]_backup_YYYY_MM_DD_XXXXXX_XXXXXX
This is automatically generated by SqlServer, and I want to remove the "_".
How I can modify this ?
Thank you in advance,
Andy.
I have faced similar situation today and used following workaround.
Use "Execute Process Task" to rename the backup. I created a batch file with following command and executed it after the Database backup task.
ren BDNAME.bak DBNAME_%date:~-4,4%%date:~-7,2%%date:~4,2%.bak
Above command will rename DBNAME.bak file to DBNAME_yyyymmdd.bak
Keep the file in the same folder where you keep the backup file. In the Execute Process Task Editor, specify batch file name in the Executable property and the location of batch file in the WorkingDirectory property.
Hope it helps.
I believe that you can use the DestinationManualList for this, although I've never used it myself and I can't seem to find documentation or examples of it anywhere. It appears in the Properties list for the Backup Database Task, but not in the dialog for it.
I don't believe you can manual edit the DestinationManualList property. Right click on the task and select Edit. In the dialog that opens click on "Back up databases across one or more files" then click on the Add button. In the Select Backup Destination dialog click on File name and enter the path including the name and extension of the file. What you've entered will then show up in the DestinationManualList collection.