The Audit Transformation in SSIS Data Flow task purposed to fetch some of system variables besides data stream columns to create a log for data stream,
You can audit transformation with source columns to have columns data besides audit information like guid of package, name of data flow task, time of execution and few other variables.
This post explains how to use Audit transformation in action.
First of all, we should set a source for our data flow scenario,
let’s choose Production.Product table in AdventureWorks sample database,
so create a package, add a data flow task , and add an oledb source pointing to AdventureWorks db, and select Production.Product as source table,
then add an Audit transformation, connect data path from source to this transformation, and go to audit transformation editor,
choose every Audit types you want, you can see list of audit types and description of them as below :
For this sample select all audit types, when you choose an audit type an output column with same name will be create, you can change name of each column as you want.
Now add an OLE DB Destination , pointing to another database, and click on New button. with clicking the new button, SSIS will generate the script for creation of destination table based on input columns,you can see audit columns there also, look at highlighted section in image
Now when you go to columns mappings tab of Destination you will see all columns mapped automatically,
That’s all, you can run the package now, and data will add into destination with audit information,
Run the package twice to see the result.