tags:

views:

43

answers:

2

Opening large sql script generated by SQL Server publisher cant be open in management studio, returning error about not enough available storage to open it.

Is there some other way to import db from large script ? (command line maybe)

A: 

Have you tried using the OSql tool?

RandomNoob
+1  A: 

Is this something you have to edit? If so, you may want to open it in Notepad++ or TextPad or Editplus.

Here are some options I can think of:

  • Use the batch separator GO between sets of commands. The reason for this is that without the GO, SSMS is trying to execute the entire script as a single command. This puts a heavier load on memory requirements than multiple batches would.

  • To run the script, you can use SQLCMD from the command line.

  • Also, for large scripts that load data, you may want to ensure that you have COMMIT commands in the script (where appropriate).

  • Consider splitting your script into multiple scripts.

  • If you split into multiple files and build the SQLCMD command line syntax, you can run all scripts from a single batch file fairly quickly.

Raj More
lol my link had a reference to the future removal of osql. +1
RandomNoob
This time I've mage Backup of target db and Restore on my machine/server with replace option and it went well. I'll take I look at what you proposed also.
daniel