Run large SQL command files


I just had a problem with importing large amount of binary data into an SQL server 2005 Express database used for a project at work.

It is not a large database in number of tables, views and stuff, but the document table contains pretty much data. The file with insert statements was on 200MB and I had problems importing the script in SQL Server Management Studio. Therefore, I needed a command line tool to do the work for me.

It didn’t take me long to find the correct SQL server syntax:

  1. Open a cmd window
  2. Type "sqlcmd -i c:\temp\script.sql" and press ENTER

It took some time to run, but after a couple of hours and heavy server load, the script completed successfully 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s