Problem:
I recently received a script which creates a database and loads data. I was unfortunately too large for SQL Server Management Studio to process.
Solution:
You can use the sqlcmd utility to run the script file. The example below shows the execution of a script file called script.sql which is located on the C drive and a connection is made to the SQL Server using integrated security.
To run the script file
- Open a windows command prompt window.
- In the command prompt window, type: sqlcmd –S SQLServerName-i C:\DatabaseLoad.sql
- Press ENTER.