Out of memory exception when running data-only script
sql-server-2008-r2
Solution
I solved it by using sqlcmd utitlity.
sqlcmd -S "Server\InstanceName" -U "instantName" -P "password" -i FilePathForScriptFile
For example :
sqlcmd -S .\SQLEXPRESS -U sa -P 123 -i D:\myScript.sql
Problem
When I run data-only script in SQL Server 2008 R2, it is showing this error: Cannot execute script Additional information: Exception of type 'System.OutOfMemoryException' was thrown. (mscorlib) The size of script file is `115MB` and it's only data . When I open this script file, it shows: ``` Document contains one or more extremely long lines of text. These lines cause the editor to respond slowly when you open the file . Do you still want to open the file ? ``` I run schema-only script first and then data-only script . Is there any way to fix this error ?