?
Solved

Open large sql file in SQL Server

Posted on 2012-04-10
8
Medium Priority
?
1,479 Views
Last Modified: 2012-04-17
I have a rather large .sql file (over 7GB) and SQL Server 2012 Express Management Studio installed on my pc. How to open this file in it? when I opened it in Management Studio, it says "operation can't be completed". Do I need to install Developer version?
Thanks
0
Comment
Question by:rdgfilings
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 6

Expert Comment

by:RaithZ
ID: 37829150
.sql files are about the same as text files, and you need a really beefy machine to open a file that large, since it loads the file into RAM.  Also depending on the program it may not be able to handle that much text.  

I would recommend seeing if you can open it with notepad.  If not then you may need to use a different computer, or split the file into smaller files if possible.
0
 

Author Comment

by:rdgfilings
ID: 37829204
notepad couldn't open it either. the machine I'm having now is the best I can get (i7-2600 CPU @ 3.4 GHz, 8GB RAM and Win7 64). I just need to export any data tables within that sql file. Can Oracle Database do it?
0
 
LVL 6

Assisted Solution

by:RaithZ
RaithZ earned 1336 total points
ID: 37829268
Its not so much about the database, its just the fact that the file is so large.  It sounds like your machine should be fine opening it but again I don't think I've ever had any luck opening a file that large.  I believe your other other option would be to find a program that will split large text files up.

Here is a free one:

http://www.gdgsoft.com/gsplit/

You would have to piece together the SQL statements but that shouldn't be too hard.  It would allow you to examine the file or work with the contents one file at a time.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 37829986
I think you need to get extra RAM.  Setting up a 7GB is simply madness.  I probably includes INSERT statement for all rows in which case it would suggest you should split it as mentioned above and run it in pieces.
0
 

Author Comment

by:rdgfilings
ID: 37830418
I used GSplit, but it seems it splitted the file into several .gsd files. Do I open them in text editor or something? If not, then it is no use, coz I need to unite them again to use the file. What's the point?
So, there's no way I can view or extract the data without modifying hardware?
0
 
LVL 6

Assisted Solution

by:RaithZ
RaithZ earned 1336 total points
ID: 37830598
What is it you need to do with the 7gb file?

you won't be able to put them all together at any point since its so much data, you can try opening the files in notepad.. but if that doesn't work, you can use another utility like the one discussed in this article:

http://www.ghacks.net/2010/10/16/split-large-text-files/

If you use the above program, I would split the file into at least 10 chunks.  

You will need to open them check them out.  If its SQL statements you may need move some of the lines of text to another file to make it work when you execute it.

If this doesn't work for you I did find a free text editor that is said to be able to open large files such as yours.  You can download it here:

http://www.vim.org/download.php#pc
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 37830691
Have you considered not opening it?  I mean let's for a minute assume you find a text editor to open this file (I have a couple that could do it).  How is that going to help you?  Are you honestly planning to edit the file?

The alternative is that all you want to do is execute it.  And for that SSMS in any Edition incarnation is not the right tool.  Instead consider using SQLCmd to run it.
0
 
LVL 10

Accepted Solution

by:
Ramesh Babu Vavilla earned 664 total points
ID: 37831318
to open a text file which is larger than 7 GB ,use this software
http://www.hhdsoftware.com/free-hex-editor
to execute the script directyl with out opening
use
this command
sqlcmd -E -S .\SQLEXPRESS -i Restore_And_Create_User_Script.sql -o RestoreDB.log
.\SQLEXPRESS :--- use instance name
-U  userName]
-P Password
-d databse name to use
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question