dbTalk Databases Forums  

How to run a query file

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss How to run a query file in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mitchman10@gmail.com
 
Posts: n/a

Default How to run a query file - 10-31-2007 , 06:02 PM






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?


Reply With Quote
  #2  
Old   
Roy Harvey (SQL Server MVP)
 
Posts: n/a

Default Re: How to run a query file - 10-31-2007 , 07:24 PM






On Wed, 31 Oct 2007 17:02:36 -0700, "mitchman10 (AT) gmail (DOT) com"
<mitchman10 (AT) gmail (DOT) com> wrote:

Quote:
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


Reply With Quote
  #3  
Old   
Ed Murphy
 
Posts: n/a

Default Re: How to run a query file - 10-31-2007 , 07:38 PM



Roy Harvey (SQL Server MVP) wrote:

Quote:
On Wed, 31 Oct 2007 17:02:36 -0700, "mitchman10 (AT) gmail (DOT) com"
mitchman10 (AT) gmail (DOT) com> wrote:

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.


Reply With Quote
  #4  
Old   
Roy Harvey (SQL Server MVP)
 
Posts: n/a

Default Re: How to run a query file - 10-31-2007 , 07:56 PM



On Wed, 31 Oct 2007 18:38:12 -0700, Ed Murphy <emurphy42 (AT) socal (DOT) rr.com>
wrote:

Quote:
Roy Harvey (SQL Server MVP) wrote:

On Wed, 31 Oct 2007 17:02:36 -0700, "mitchman10 (AT) gmail (DOT) com"
mitchman10 (AT) gmail (DOT) com> wrote:

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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.