How to import large .sql file in MS SQL Server

1 1 1 1 1 How to import large .sql file in MS SQL Server5.00Rating 5.00 (1 Vote)

Sometimes you need to import large database into MS SQL Server, but when you use Microsoft SQL Server Management Studio, it doesn't do the job right, but shows the message "Insufficient memory". Or maybe you need to do a batch import of sql script to database instead of doing the import by hand. Here comes in handy the sqlcmd command line tool. It can import large .sql files, can be run from a batch script, installer, etc.

How to use sqlcmd command-line tool to import large .sql file?

Open a command prompt window.
In the Command Prompt window, type: sqlcmd -S yourServer\instanceName -i C:\yourScript.sql
Press ENTER.
The progress of operation is written to the command prompt window.

Source: Microsoft

Thursday the 18th.