July 14, 2008 at 5:19 am
I've created a text log file in a package to hold execution results, but it's growing in size at an alarming rate. I need to be able to refer to the info in the file, so I don't want to stop it exporting the results to the file, however I would like to limit the number of lines it's exporting at present. As time goes on the earlier logged entries are of less importance to me so I think I can truncate the length of the log file. However I'm not sure what the best method is to delete the first x number of lines from the text file apart from importing in to a sql table and and using a select top command to write out the lines. Seems a bit over the top that though. Any ideas please?
July 14, 2008 at 6:30 am
Instead of writing to a text file, why not write to a table where each row has a "create date"?
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2008 at 7:38 am
Is there no way of doing what I'm trying to do with text files though?
July 14, 2008 at 7:57 am
You mean withing T-SQL? Sure... import the file... delete the desired rows... export the file. You could also write some VBS using the System File Object to do it for you and use xp_CmdShell to execute it.
--Jeff Moden
Change is inevitable... Change for the better is not.
July 14, 2008 at 8:01 am
OK then, so a workaround within SSIS rather than a function of SSIS it sounds. Thanks for your assistance here Jeff.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply