Name change

  • mtz676

    SSCrazy Eights

    Points: 8895

    $LDS = "Data Source="
    $RDS = ";Initial Catalog="
    $OldString = "AAAAAAAAAA"
    $NewString = "ZZZZZZZZZZ"
    $MyFolder = "C:\SSIS"
    $files = get-childitem "$MyFolder" *.dtsx | Where-Object {!($_.PSIsContainer)}
    foreach ($file in $files)
    (Get-Content $file.FullName) | % {$_ -replace "($LDS) ($OldString)($RDS)",
    "'$1$NewString'$3"} | Set-Content $file.FullName;

    I have many SSIS packages where the source server name needs to be changed
    How can I do that?
    I have all the SSIS packages in a single folder.
    The above piece is throwing error - bad numeric constant.
    Assistance is appreciated.


    • This topic was modified 4 months, 1 week ago by  mtz676.
  • Jeffrey Williams 3188

    SSC Guru

    Points: 88248

    Not sure I understand what you are trying to do - but it shouldn't be necessary.  If you are using Project Deployment to an Integration Services Catalog you can modify the data source(s) in the catalog or the agent job.

    You can (and probably should) create shared data sources in your project so all packages reference the shared data source - this way you only have to make the change one time and all packages in the project will use the new source.

    If you are still using package deployment to a file location or package store - I would highly recommend moving everything into projects and using project deployment.


    [font="Verdana"]Jeffrey Williams
    Problems are opportunities brilliantly disguised as insurmountable obstacles.

    How to post questions to get better answers faster[/url]
    Managing Transaction Logs[/url]

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply