How to run big sql script file (edit)
https://archive.codeplex.com/?p=bigsqlrunner
Here's project that enables any developers or others to run the big sql script file greater than 300MB or any size. It also supports rollback feature & others.
Folder: ..\BigSqlRunner\sourceCode\bigsqlrunner\release\
https://knowledgebase.apexsql.com/how-to-execute-large-sql-scripts/
To run these scripts use:
- The osql command line utility that comes with SQL Server:
osql -H <computer_name> -S <instance_name> -U <username> -P <password> -i <path> - The sqlcmd command line utility that comes with SQL Server:
sqlcmd -S <computer_name\instance_name> -d <database_name> -i <path> -o <output> - ApexSQL Run Script:
- Download ApexSQL Run Script
- Unzip it into a folder
- Use the Command line and navigate to the folder where the file was unzipped
- Run the utility with the following parameters:
ApexSqlRunScript <computer_name\instance_name> <database> <path>
SELECT name, physical_name AS current_file_location FROM sys.master_files SELECT @@SERVERNAME
C:\Program Files\Microsoft SQL Server\xxx\Tools\Binn\SQLCMD.EXE
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\xxx\Tools\Binn\SQLCMD.EXE
sqlcmd -S [MSSQLSERVER] -U sa -P 123456 -d [DemoDB] -i "DemoDB_Script.sql"
C:\Program Files\Microsoft SQL Server\xxx\Tools\Binn\bcp.exe
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\xxx\Tools\Binn\bcp.exe