Ad Code

Execute Large SQL Script File by using SQLCmd

Execute Large SQL Script File by using SQLCmd:

When running a large script file in SQL Server Management Studio (SSMS), you will get following error "unable to run the script. There is not enough memory to continue running the programme. (mscorlib) "?

Even with SQL Server 2014, there remains a problem with SSMS's inability to manage huge script files. This advice will explain how to solve this issue without SSMS by using the SQLCMD programme from the command line.

We face issues while uploading, inserting more than 2GB sql file, it throws an error. In this blog you will learn how to upload sql file in MSSQL Server through sqlcmd.

After executing below query you will be able to upload 2GB,  3GB,  4GB,  5GB,  6GB,  and So on.

 

Executed the SQL Script file by using SQLCmd and it worked :

 

Go to Run, type CMD and then paste and hit Enter

 

sqlcmd -S [servername] -d [databasename] -i [scriptfilename]

 

e.g.

sqlcmd -S MyServerName\InstanceName -d MyDataBaseName-i c:\MySQLScriptFile.sql

 


Post a Comment

0 Comments

Close Menu