How to execute a query with large data volume?

2

Is there any way to run a file with a large volume of data without being direct in SQL Server 2014 Management Studio , as I try to open to execute and get the following error:

  

Can not run script. Insufficient memory to continue   implementation of the program. (mscorlib)

Local do Programa:

   em System.Runtime.InteropServices.Marshal.AllocCoTaskMem(Int32 cb)
   em Microsoft.SqlServer.Management.UI.VSIntegration.ShellTextBuffer.GetText(Int32 startPosition, Int32 chars)
   em Microsoft.SqlServer.Management.UI.VSIntegration.ShellTextBuffer.get_Text()
   em Microsoft.SqlServer.Management.UI.VSIntegration.ShellCodeWindowControl.GetSelectedTextSpan()
   em Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptEditorControl.GetSelectedTextSpan()
   em Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl.OnExecScript(Object sender, EventArgs a)
    
asked by anonymous 09.11.2015 / 18:58

1 answer

3

For these cases, the way is to use the command prompt or Powershell and run the script using:

> sqlcmd -S COMPUTADOR\INSTANCIA -i .\MeuScript.sql -d MeuDatabase

I usually run like this:

> sqlcmd -S .\SQLEXPRESS -i .\MeuScript.sql -d MeuDatabase

Read more about sqlcmd here .

    
09.11.2015 / 19:02