Google Answers Logo
View Question
 
Q: SQL Server Insert Query Problem ( No Answer,   5 Comments )
Question  
Subject: SQL Server Insert Query Problem
Category: Computers > Programming
Asked by: dynamicdealer-ga
List Price: $30.00
Posted: 13 May 2004 08:37 PDT
Expires: 12 Jun 2004 08:37 PDT
Question ID: 345791
OK, here are details of my problem.
I have a server with IIS 5.0 and SQL Server 2000 installed. I have
more than 20 web sites and databases associated with them which are
all running fine.

I have a problem with one database.
I connect using SQL Query Analyzer to the database and type a pretty
basic insert query. This takes 40-50 seconds to execute.

Then I try the same insert query and it takes less than a second. It
works fine, but then I don't know how or when, it gets broken again
and it again takes 50 seconds to execute.

To make the long story short, insert query takes long time to execute
for the first time but the rest takes very short time.

I can give you access to my sql server by inviting you to my server
using gotomypc.com

Thanks for your help in advance.

Request for Question Clarification by mathtalk-ga on 13 May 2004 09:17 PDT
When you describe the insert query as "basic", do you mean that you
are using the INSERT ... VALUES (...) syntax to insert a single row?

How do you connect to the database using SQL Query Analyzer?  Are you
using a TCP/IP connection or named pipes?  Are you using SQL Server
authentication or domain authentication?  Is the query client on the
same machine or a different machine as the database (and IIS 5.0)?

Finally, have you tried bringing up the Performance Monitor applet
during these long time lapses, to see if either CPU or disk activity
is high?

regards, mathtalk-ga

Clarification of Question by dynamicdealer-ga on 13 May 2004 09:35 PDT
Yes, I ony insert one row...
I am using tcpip connection and using windows authentication.
Yes it is on the same machine.

No i didn't check the performance monitor. as i said it goes away
after the first insert query then comes back i don't know 10 hours 
later...

Request for Question Clarification by mathtalk-ga on 13 May 2004 12:05 PDT
One thing to try is changing the SQL client configuration to use named pipes.  

It sounds like either a "network" latency issue (routing to
localhost?) or that SQL Server 2000 is configured with minimal
reserved memory and has to page out quite a bit of stuff unrelated to
your INSERT before it has room to do that.  In the latter case the
performance monitor (right click on the toolbar and select Task
Manager and its Performance tab) will be able to show you disk
activity (assuming its not obvious from a disk activity light on the
front panel of your PC).

regards, mathtalk-ga

Clarification of Question by dynamicdealer-ga on 21 May 2004 16:42 PDT
No, sir...if you need i can give you access to the server via webex like service...
Answer  
There is no answer at this time.

Comments  
Subject: Re: SQL Server Insert Query Problem
From: justintmanx-ga on 14 May 2004 03:54 PDT
 
If you get the behaviour for all types of queries, i.e. not just
inserts. Check that you do not have Auto close set on the options for
that particular database.
Subject: Re: SQL Server Insert Query Problem
From: dynamicdealer-ga on 14 May 2004 08:41 PDT
 
Hi
Auto Close is not checked, by the way I have 20 other databases that
are all working fine. This one gives me problem only inserting...
Subject: Re: SQL Server Insert Query Problem
From: mathtalk-ga on 14 May 2004 10:59 PDT
 
Hmmm.  Is there a trigger on this particular table?

-- mathtalk-ga
Subject: Re: SQL Server Insert Query Problem
From: dynamicdealer-ga on 21 May 2004 14:59 PDT
 
No
Subject: Re: SQL Server Insert Query Problem
From: mathtalk-ga on 21 May 2004 16:23 PDT
 
Does it have a clustered index defined on it?

-- mathtalk-ga

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy