Skip to content

Instantly share code, notes, and snippets.

@matt40k
Created May 27, 2015 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt40k/b57237b3d3a832537139 to your computer and use it in GitHub Desktop.
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
$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