Advertisement

06.20.2008 at 06:26PM PDT, ID: 23504027
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

SQL script running extremely slowly

Asked by roymene in MS SQL Server

Tags: , , ,

I have some very large scripts consisting of hundreds of thousands of INSERT statements.  (these is the only "option" I've been given to import this data into my database).  The script first creates a new table, then proceeds to populate with INSERT statements

The scripts take hours to run.  For example one script contain 108,000 INSERT statements takes 45 minutes to run.  The size of the script file is 37MB.  I am not sure why it is taking so long.

Here is the command line I use to execute the SQL:
"C:\Program Files\Microsoft SQL Server\90\Tools\Binn\sqlcmd" -d DBname -i .\DataFiles\sqlscript.sql  -o Logfile.log

Included below is a code snippet with the first two INSERT statements.

Any idea why this is taking so long and what I can do to improve on it?

Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
USE DBname;
CREATE TABLE VOUCHER
(
VO004_VENDOR_NO   CHAR (11) NOT NULL,
VO012_VOUCHER_NO  CHAR (07) NOT NULL,
VO028_ACCT_1_6    CHAR (06) NOT NULL,
VO032_ACCT_7_10   CHAR (04) NOT NULL,
VO052_DROP                 CHAR (01),
VO054_RECON                CHAR (01),
VO056_PURGE                CHAR (01),
VO062_HOLD                 CHAR (01),
VO064_VOID                 CHAR (01),
VO066_PF                   CHAR (01),
VO068_ENC                  CHAR (01),
VO070_DISC_LOST            CHAR (01),
VO072_1099                 CHAR (01),
VO089_TC_ALL               CHAR (03),
VO094_PO_NO       CHAR (07) NOT NULL,
VO100_BANK        CHAR (02) NOT NULL,
VO110_CHECK       CHAR (06) NOT NULL,
VO122_INV_NO   VARCHAR (14) NOT NULL,
VO126_DESC              VARCHAR (15),
VO130_INV_DATE             CHAR (08),
VO140_DUE_DATE             CHAR (08),
VO150_CHECK_DATE           CHAR (08),
VO151_CHECK_AMT            DECIMAL(9,2),
VO152_CHECK_AMT_VOIDED     DECIMAL(9,2),
VO170_INV_AMT              DECIMAL(9,2),
VO172_DISC_AMT             DECIMAL(7,2),
VO174_NET_AMT              DECIMAL(9,2),
VO180_LIAB_ACCT            CHAR (10),
VO204_TAX_AMT              DECIMAL(9,2),
VO310_BATCH_REF            CHAR (06),
VO331_BATCH_YY             CHAR (02),
VO332_BATCH_MM             CHAR (02),
VO333_BATCH_DD             CHAR (02),
VO338_FY          CHAR (07) NOT NULL,
VO346_FISCAL_MONTH CHAR (02) NOT NULL,
VO350_WORK_ORDER  CHAR (10) NOT NULL
);
GO
INSERT INTO VOUCHER VALUES (
'C0000042310','4503546','141381','5210','0','0','1','0','0',' ',' ','0','S','140','IC     ','25','838255','SPRING 2006   ','               ','20060713','20060718','20060717',     31620.28,          .00,     31620.28,        .00,     31620.28,'0140002100',          .00,'VPJ172','06','07','17','2006-07','06','          '
);
INSERT INTO VCHR VALUES (
'C0000042310','4509329','141381','5210','0','0','1','0','0',' ',' ','0','S','140','IC     ','25','840756','SUMMER 2006   ','               ','20060919','20060921','20060920',     25929.28,          .00,     25929.28,        .00,     25929.28,'0140002100',          .00,'VPJ201','06','09','20','2006-07','09','          '
);
[+][-]06.20.2008 at 07:09PM PDT, ID: 21836041

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 07:12PM PDT, ID: 21836048

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 07:19PM PDT, ID: 21836079

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 07:29PM PDT, ID: 21836097

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 07:30PM PDT, ID: 21836102

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 07:34PM PDT, ID: 21836117

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 07:36PM PDT, ID: 21836119

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.20.2008 at 09:20PM PDT, ID: 21836314

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.20.2008 at 09:31PM PDT, ID: 21836337

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.21.2008 at 03:22AM PDT, ID: 21837062

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 11:37AM PDT, ID: 21848961

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Tags: Microsoft, Sql Server, 2005, running sqlcmd script on command line
Sign Up Now!
Solution Provided By: roymene
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.10.2008 at 01:06AM PDT, ID: 22436155

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628