473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to run a query file

I have a query file, test.sql, in the root of my C drive. It is
400,000 lines worth of insert into statements and is so big i cannot
load in into management studio. How can I run this?

Nov 1 '07 #1
3 2990
On Wed, 31 Oct 2007 17:02:36 -0700, "mi********@gmail.com"
<mi********@gmail.comwrote:
>I have a query file, test.sql, in the root of my C drive. It is
400,000 lines worth of insert into statements and is so big i cannot
load in into management studio. How can I run this?
Add a line with nothing but a GO every, oh say after every 100 INSERT
commands. Then you could TRY to execute the file using the command
line utilities OSQL or SQLCMD. I'm not sure if they will choke on a
file that size as I've never had reason to test them in that way.

Roy Harvey
Beacon Falls, CT
Nov 1 '07 #2
Roy Harvey (SQL Server MVP) wrote:
On Wed, 31 Oct 2007 17:02:36 -0700, "mi********@gmail.com"
<mi********@gmail.comwrote:
>I have a query file, test.sql, in the root of my C drive. It is
400,000 lines worth of insert into statements and is so big i cannot
load in into management studio. How can I run this?

Add a line with nothing but a GO every, oh say after every 100 INSERT
commands. Then you could TRY to execute the file using the command
line utilities OSQL or SQLCMD. I'm not sure if they will choke on a
file that size as I've never had reason to test them in that way.
Failing that, split it up into multiple files (by whatever means you
like) and execute them individually.
Nov 1 '07 #3
On Wed, 31 Oct 2007 18:38:12 -0700, Ed Murphy <em*******@socal.rr.com>
wrote:
>Roy Harvey (SQL Server MVP) wrote:
>On Wed, 31 Oct 2007 17:02:36 -0700, "mi********@gmail.com"
<mi********@gmail.comwrote:
>>I have a query file, test.sql, in the root of my C drive. It is
400,000 lines worth of insert into statements and is so big i cannot
load in into management studio. How can I run this?

Add a line with nothing but a GO every, oh say after every 100 INSERT
commands. Then you could TRY to execute the file using the command
line utilities OSQL or SQLCMD. I'm not sure if they will choke on a
file that size as I've never had reason to test them in that way.

Failing that, split it up into multiple files (by whatever means you
like) and execute them individually.
Which might be no more work than adding the GO lines.

Roy Harvey
Beacon Falls, CT
Nov 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
9
by: netpurpose | last post by:
I need to extract data from this table to find the lowest prices of each product as of today. The product will be listed/grouped by the name only, discarding the product code - I use...
0
by: pepin_labulle | last post by:
I'm a newbie with XQuery and I'm trying to execute a query with Saxon. If I don't specify the XML source file name in the query, Saxon raises the following error :...
7
by: Dan V. | last post by:
Situation: I have to connect with my Windows 2000 server using VS.NET 2003 and C# and connect to a remote Linux server at another company's office and query their XML file. Their file may be...
8
by: Adam Louis | last post by:
I would like help resolving this problem. I'm a novice who's been hired to query a hospital database and extract useful information, available to me only in a dynamically generated, downloadable...
4
by: deko | last post by:
When using OutputTo with a query, the 'File name' window in the 'Output To' dialog gets populated with the name of the query by default. This makes the exported file self-describing if the query...
17
by: NeoAlchemy | last post by:
I am starting to find more web pages that are using a query parameters after the JavaScript file. Example can be found at www.opensourcefood.com. Within the source you'll see: <script...
4
by: DavidPr | last post by:
I have a table that records (suppose to) the number of times a resume is viewed. When someone clicks on a Send Resume link from a job ad, an email is sent to the employer telling him/her that...
3
by: Wayne | last post by:
I'm trying to automate the export of a query to a text file using code. If I export the query manually I get the exact result that I want i.e. If I select the query then choose File/Export from...
9
by: Sinner | last post by:
Hi, I have a field name 'USER' in tableMAIN. How do I replace the user names with corresponding user names. I can do that in xl using vlookup but now I'm trying to find a way to do that in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.