Run 3.5G.sql file on SQL Server 2008

I use SQL Server for Windows 8, 32bit, 2GB of memory. I want to execute .sqla 3.5 GB file .

I tried to do:

  • SSMS - request user interface - insufficient memory exception - NO LUCK
  • sqlcmd - insufficient memory exception - NO LUCK
  • divide the file into 18 files of 200 MB in size. sqlcmd each of them is NO GOOD LUCK
    (btw no editor can open such a huge file. Even a 200MB file contains a line of ~ 18,000,000. Suggestions are welcome)
  • put GO after each DML statement in .sqlto reduce the size of the redo log - NO LUCK
    (surprisingly this worked for my other 280 MB file).

Did .bakthe file help?

Is there (I hope there is) a way to do what I'm trying to do in a good way?

Thank.

+5
source share
2 answers
According to msdn  https://msdn.microsoft.com/en-us/library/ms170572.aspx

1) Open a command prompt window.
2) In the Command Prompt window, type: sqlcmd -S myServer\instanceName(local) -i C:\myScript.sql(path where sql script exists)
3) Press ENTER.
+3
source

I managed to run the file 17.9 GBusing osql with something similar to the following command line, executing it locally from the command line. This can take quite some time.

osql -S . -d Test -E -i script.sql
+2
source

All Articles