views:

3210

answers:

5

Hi

I want to create a Log file in SSIS... I know hoe to create through management studio.but i wanted to run my SSIS package through Command Prompt... can you help me to get the DOS commands for that?

+2  A: 

You can use the /L option, as documented here; however, you can also set Logging up in a much easier and finer way through the SSIS>Logging menu in Visual Studio.

Cheers,
Eric

Eric
yes i used dtexec /f "C:\\Package.dtsx" /l "DTS.LogProviderTextFile;D:\Sample_Examples\Log.log"like this...but i am getting two errors like 1. The connection "D:\Sample_Examples\Log.log" is not found. This error is thrown by connections collection when the specific connection element is not found 2. connection manager is nt foundany idea on this?
sona
+2  A: 

In your SSIS you need to create and configure an SSIS Log provider before you can use it. Look into link text for more info.

bart
Yes i have check the link but in that they are explaining how to enable Logging thorugh BIDS...I wanted to create the Logging using DOS commands...any idea on this?
sona
A: 

You need to set up the a new connection string inside of BIDS. where you have to specify the path of Log file...i mean here path will be D:\Sample_Examples\Log.log... and name of the connection manager will be Log.log so now the command prompt will get changed into dtexec /f "C:\Package.dtsx" /l "DTS.LogProviderTextFile";"Log.log" instead of dtexec /f "C:\Package.dtsx" /l "DTS.LogProviderTextFile;D:\Sample_Examples\Log.log" we cant specify a direct path after DTS.LogProviderTextFile...because of that only i got error...

Thank you very much for the suggestions...

sona
+1  A: 

You can do this another way, without going into your SSIS package.

Create a batch file and run DTEXEC in a new instance of CMD, i.e.:

CMD /C DTEXEC your package and args > log file

When you do this, you can run this batch file and get your log file.

See http://richarddingwall.name/2009/01/26/capture-the-output-from-a-scheduled-task/ for more details

Peter M
Great Peter...Thanks for your information...
sona
One note on this approach: be careful about invoking an SSIS package this way and then trying to do an logic around the %ERRORLEVEL% variable. Supposedly this should be non-zero when your package errors out, but I've seen it return zero when the package clearly failed.
Peter M
A: 

Yes, you have to create a connection manager for the log provider; however; there is no documentation on how to do this if you are using a custom log provider.

Flea