Skip to content

Instantly share code, notes, and snippets.

@DavidRogersDev
Created June 27, 2018 01:26
Show Gist options
  • Save DavidRogersDev/5d0c38d39a104ab850ee0c898753b8b7 to your computer and use it in GitHub Desktop.
Save DavidRogersDev/5d0c38d39a104ab850ee0c898753b8b7 to your computer and use it in GitHub Desktop.
Concatenate all sql scripts in a directory into 1 script. I end every script file with a GO statement, which separates them in the consolidated script file.
$file = "consolidated-script.txt"
$filenew = "consolidated-script.sql"
cat *.sql | sc consolidated-script.txt
Rename-Item $file $filenew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment