Monday, July 13, 2020
Beetle Blog
Large scripts cannot run in SQL Management Studio due to memory error
By: douglas - Sql Server - 5/1/2010 7:33:52 PM

 If you try to run a very large script in SQL Management Studio (2005, 2008) it may not run.  Instead it may give a "System.OutOfMemoryException" error.

In order to run the script you can use the sqlcmd in the command line instead.

sqlcmd -S YOURSQLSERVER\INSTANCENAME -i "C:\Your Script.sql”

Example connecting to a remove database using sql server authentication:

sqlcmd -S -i -U -P -d

Note that username and password are sent using clear text.

Last Modified: 3/16/2011 11:13:44 PM

Beetle Blog v0.2.2

Copyright © 1997 - 2020 All rights reserved.