Solved

Open large sql file in SQL Server

Posted on 2012-04-10
8
977 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
8 Comments
 
LVL 6

Expert Comment

by:RaithZ
Comment Utility
.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
Comment Utility
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 334 total points
Comment Utility
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
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:rdgfilings
Comment Utility
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 334 total points
Comment Utility
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
Comment Utility
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:
sqlservr earned 166 total points
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now