Normally I work with machines with enough resources to open such files, so I'm able to create the databases on SQL Server using the Management Studio. But since last week I've been working on a MacMini with just 4GB of memory, what to do when you need to open a 2GB SQL file into Management Studio? Well go do something else, because it's going to take some time.
Today I found a very elegant way to do it, using the utility SQLCMD.
Using this tool, available in your path if you have SQL Server installed, all you need to do is:
- Open a command prompt window.
- In the Command Prompt window, type: sqlcmd -S myServer\instanceName -i C:\myScript.sql
- Press ENTER.