dzolnjan
dzolnjan

Reputation: 1263

Import SQL Server database from large script

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)

Upvotes: 2

Views: 2790

Answers (2)

Raj More
Raj More

Reputation: 48048

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.

Upvotes: 2

Ta01
Ta01

Reputation: 31630

Have you tried using the OSql tool?

Upvotes: 0

Related Questions