Created
May 27, 2015 21:26
-
-
Save matt40k/b57237b3d3a832537139 to your computer and use it in GitHub Desktop.
Create SQL objects with the file name of NNNN_SCHEMA_OBJECTNAME.sql - this script allows you to bulk change the schema name on the files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$dir = 'C:\svn\SQL' | |
$files = Get-ChildItem $dir -Filter *.sql | |
Foreach ($file in $files) { | |
$old = $file.FullName | |
$new = $old.Replace("_OldSchema_", "_NewSchema_") | |
Rename-Item -path $old -NewName $new | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment