Skip to content

Instantly share code, notes, and snippets.

@mintsoft
Created July 3, 2013 11:08
Show Gist options
  • Save mintsoft/5917067 to your computer and use it in GitHub Desktop.
Save mintsoft/5917067 to your computer and use it in GitHub Desktop.
Dumps the content of SQL Tasks in SSIS dtsx packages to files for easier diff-ing in source control.
import-module SSIS
$ssis_package = "D:\MyFile.dtsx";
$package = Get-ISPackage -path $ssis_package;
$package.Executables | Where-Object { $_.InnerObject -like 'Microsoft.SqlServer.Dts.Tasks.ExecuteSQLTask.ExecuteSQLTask' } | %{ $fn = $_.Name+".sql"; $_.InnerObject.SqlStatementSource > $fn }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment