raja atif
raja atif

Reputation: 188

SQL script too large can not open in SQL Server

I have a SQL script file that has size of 3.55 GB. When I try to open it in SQL Server, I get an error

System.outOfMemoryException

I have only script option to import data because in my local PC I have SQL Server 2012 and in my live domain I have SQL Server 2008 R2 so I generated SQL Server 2008 R2 scripts with data.

Can any one help me with this?

Upvotes: 2

Views: 3063

Answers (2)

Yasir Majeed
Yasir Majeed

Reputation: 741

If the script lines are not dependent on each other, you can split the file using sed utility. sed utility is also available for windows in MinGW. It can split the files from line numbers that you provide. If the scripts lines are dependent on each other then you can use https://bigsqlrunner.codeplex.com/. Its a good point to start

Upvotes: 1

marc_s
marc_s

Reputation: 755411

To run this large script file, you should look at the SQLCMD command-line utility provided with SQL Server.

It should be able to handle even very large scripts indeed.

If that doesn't work, then you'd need to make sure to create multiple, smaller scripts to handle the work

Upvotes: 3

Related Questions