Logging an SSIS task
I set up a connection in my SSIS program to a folder/file for logging. When I run the SSIS program I have to go to the logging tab, select 'SSIS log provider for Text files' then select my Log connection in the Configuration String. Is there
a way to do this automatically? Can I run a script that includes these settings? Can this be done from a SQL Agent job?
Thanks.
June 4th, 2012 9:14am
You can trigger the on-demand logging by applying the /L (which can be used in conjunction with /Rep parameter) and /VLog to the
DTExec.
Applying the switch from within SQL Agent is not possible, but if you script the Agent job creation then you can amend the switches on the fly with the script.
Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 9:21am
Thanks.....I had forgotten about the DTEx utility.
Can you explain "script the Agent job"? Would that involve using powerhell inside Agent?
June 4th, 2012 9:50am
You can script a ready job from the SSIS and then generate it programmatically overriding the dtexec parameters as needed (based on a condition), so you would delete a job, script a new one up and then schedule to have the logging or not working.
But IMHO, I would just leave the logging on for all runs.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 9:54am
The command line generated by the execute pacakge utility is:
/FILE "C:\SSIS\Master.dtsx" /CHECKPOINTING OFF /REPORTING EWCDI /LOGGER "{0A039101-ACC1-4E06-943F-279948323883}";Log
Where would I run that to execute the package with the proper logging?
Thanks again.
June 4th, 2012 10:24am
The SSIS job step allows to override the command line it generates, so this is the place where you amend it.
Click on edit the command line manuallyArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 10:26am
Can I run the command externally so I can kick it off without having to manually add the log provider and connection?
That is my basic question.
June 4th, 2012 10:32am
Yes, you can. For example you can run it from a bat file.Arthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 10:34am
'/FILE' is not recognized as an internal or external command...
June 4th, 2012 10:41am
Your complete dtexec command in a script must be like
DTExec /FILE "C:\SSIS\Master.dtsx" /CHECKPOINTING OFF /REPORTING EWCDI /LOGGER "{0A039101-ACC1-4E06-943F-279948323883}";LogArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 10:45am
Error:
The version number in the package is not valid.
package migration from version 3 to version 2 failed
June 4th, 2012 10:48am
The fix is in there: http://blogs.msdn.com/b/ramoji/archive/2008/12/24/package-migration-from-version-3-to-version-2-failed-with-error-0xc001700a-the-version-number-in-the-package-is-not-valid-the-version-number-cannot-be-greater-than-current-version-number.aspxArthur My Blog
Free Windows Admin Tool Kit Click here and download it now
June 4th, 2012 10:50am
EXCELLENT!!!!
Thank you for your patience!
June 4th, 2012 11:08am
Hi Arthur-
I've been using this method for a while now and it works great. I'd like to make the log file a little more useful - do you know of a way to pass messages from within a vb.net script task to this log file?
thank you!
Johnny
Free Windows Admin Tool Kit Click here and download it now
November 7th, 2012 11:57am