SSIS (SQL Server 2005 Integration Services ) is the data transformation standard in SQL 2005 which replaces the DTS packages in SQL 200o.SSIS has a platform for building high performance data integration solutions, including extraction, transformation, and load (ETL) packages for data warehousing.

You can start doing SSIS using Business Intelligence Studio which provides a graphical tool kit for designing and debugging SSIS packages. It has more functionalities than DTS(in SQL 2000) and it can work parallel packages faster. I would like to explain how to create SSIS packages using this blog mainly because when I was learning there were not many resources to learn. So I would like to explain the functionalities of SSIS using graphics/Vedios in a simpler way

Monday, April 21, 2008

How To Create A Dynamic Log File In SSIS

In SSIS you can create a log file to track the behavior of the SSIS package execution. These are the steps used when creating a dynamic log file
  • Create a log file in connection manager.
    • Right click on connection manager ->New File Connection->give the proper sources to the log file.(Usage type- ,Existing file/New file Path- path of the log file)

    • Or go to SSIS -Login (in the menu bar) and create a new File Connection

  • Login Configurations
    • In the menu bar Click SSIS -> Logging.

    • Click checkbox for the Package(left side).

    • Select the configuration and give a name for the log file.

    • Click the Details tab to fire the events.

  • Making the log file dynamic

    • In the properties tab of the log file connection (click on log file in the connection manager and view the properties tab) Click on expression and give the following settings



    • Property – Connection String

    • Expression - @[User::gvErrorLogDir] + @[System::PackageName] + " "+ (DT_WSTR, 4) YEAR( GETDATE() ) + "-"+ ((LEN((DT_WSTR, 2) MONTH( GETDATE() ) )>1)?(DT_WSTR, 2) MONTH( GETDATE() ):"0" + (DT_WSTR, 2) MONTH( GETDATE() ) )+"-"+((LEN((DT_WSTR, 2) DAY( GETDATE() ) )>1)?(DT_WSTR, 2) DAY( GETDATE() ): "0"+ (DT_WSTR, 2) DAY( GETDATE() ) ) + " " + ((LEN((DT_WSTR, 2) DATEPART("Hh", GETDATE() ) )>1)?(DT_WSTR, 2) DATEPART( "Hh", GETDATE() ) : "0" +(DT_WSTR, 2) DATEPART( "Hh", GETDATE() ) ) + "h-"+ ((LEN((DT_WSTR, 2)DATEPART( "mi", GETDATE() ) )>1)?(DT_WSTR, 2) DATEPART( "mi", GETDATE() ) :"0" + (DT_WSTR, 2) DATEPART( "mi", GETDATE() ) ) + "File.txt"


Relevant Links
How To Create A Logger In SSIS
SSIS Junkie
Integration Services Log Providers-MSDN

2 comments:

kumar said...

if the package runs for 15 minutes, Will this package generate multiple log files. If not, how?

kumar said...

if the package runs for 15 minutes, Will this package generate multiple log files. If not, how?