Everyday is an interesting day in the life of a DBA. Today, I received a request to run in a HUGE script. This script had 125k INSERT statements each in a separate line. Just opening the script was an issue, leave alone running it into a database. You get this error in SSMS just trying to open – “The operation could not be completed. Not enough storage is available to complete this operation”
This is how I handled it
- I split the file into a manageable 1000 line files (total of 125 files)
- Looped through each split file and ran it in!
Yes, it was that simple. Thanks to PowerShell!
Read on to see how simple it is.