Building a Transaction logfile transfer Expression

  • I am trying to FTP transaction logfiles to a server. I can get the FTP connection working that I was able to transfer a text file as a test but I am having problem in defining an expression that will know the latest file to be transfered. Any help will be appreacited

  • How will the file be named and do you transmit more than one file a day?

  • yes I will transmitt more than one file in a day. Actually I will transmitt the transaction logs from the backup drive to a folder in the remote server. The transaction logfiles are named with sql server standars naming with the .trn and time stamp at the end of each file

  • I dont know of a way to determine the newest file in a directory without performing some advanced scripting. You still have options here, but I do not know what kind of leeway you have. You can dump the log to the folder. Use the "Enumerating files in a Foreach loop" control to process the ftping of the file. You can then either delete the file or check to make sure the file exists on the remote drive then delete.

  • I have the delete part now, but can you help with the dumping of the file that you talked of to a folder.

  • You can use the file system task to copy the backup to a folder of you choice.

  • If you do not want to use the file system task you still have other options. These options include mirroring a copy of the file to the folder of your choice. Another option is to use a sql task. You would have to use xp_cmdshell to copy the file and setup if/else logic that assign a name to your backups based on the time of day.

    E.g. SQL creates backup files with the filename backupnameyyyymmddtttt.trn. Say your backups occur at 1:00 PM and 5:00PM. You could create a script that checks the current time and if it is greater than 1:00PM and Less than 5:00PM sets the filename to mydb200803031300.trn. You could then use xp_cmdshell to copy the file to the directory.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply