Wednesday, August 8, 2007

Editing large scripts with Sql Management studio

Sometimes it is required to manage large SQL scripts, especially if you want to migrate data by hand. Let's see how it is look like with Microsoft Sql Management Studio:

I had the SQL script and opened using the file open function. I wanted to reorganize the file using the copy/past feature, when this dialog appeared:

You are attempting to copy more than 194049 lines to the Clipboard. This may decrease performance. "You are attempting to copy more than 194049 lines to the Clipboard. This may decrease performance." 194049 lines didn't seem to a large amount of data (in the end of 2006).

Anyway I was able to copy/paste, but it was terribly slow. After the modifying the file I also wanted to run it:

Insufficent memory to continue the execution of the program.The memory was not enough, my PC had 1 GB. Check the details of the exception, it was a usual .Net stack trace:
System.OutOfMemoryExceptionFinally, I manged to execute the script in multiple smaller parts, but after I wanted to save it:

The operation could not be completed. Not enough memory."The operation could not be completed. Not enough memory." - at least the second part of the error message was translated to Hungarian.

No comments: