473,385 Members | 1,342 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,385 software developers and data experts.

Interrupt processing of a large insert process in SQL server 2000.

I'm running a resource-intensive stored procedure, which reads a file
with about 50,000 lines with a BULK INSERT into a temp table, then
goes through it and inserts a record for each line into another table.
While this procedure is running, SQL server stops accepting any other
requests coming from the website.
Question:
Is there a way to make SQL server "listen", or emulate an "interrupt"
to other requests while in the middle of a long intensive process?

I really appreciate your replies.
Thank you,
Oleg.
Jul 20 '05 #1
5 3483
ob******@excite.com (Oleg Berfirer) wrote in message news:<27**************************@posting.google. com>...
I'm running a resource-intensive stored procedure, which reads a file
with about 50,000 lines with a BULK INSERT into a temp table, then
goes through it and inserts a record for each line into another table.
While this procedure is running, SQL server stops accepting any other
requests coming from the website.
Question:
Is there a way to make SQL server "listen", or emulate an "interrupt"
to other requests while in the middle of a long intensive process?

I really appreciate your replies.
Thank you,
Oleg.


It's not clear from your description what "stops accepting" means, but
I guess that perhaps your load is locking the final table, so other
processes cannot access it. You could check this using sp_lock while
the load process is running.

If that is the case, then you may need to review the insert from the
temp table - are you processing each row individually in a loop or
cursor, for example? If possible, a single INSERT statement would be
the most efficient way to do it, but without more information on
exactly what you're doing and how, that's just a guess.

Simon
Jul 20 '05 #2

"Oleg Berfirer" <ob******@excite.com> wrote in message
news:27**************************@posting.google.c om...
I'm running a resource-intensive stored procedure, which reads a file
with about 50,000 lines with a BULK INSERT into a temp table, then
goes through it and inserts a record for each line into another table.
While this procedure is running, SQL server stops accepting any other
requests coming from the website.
Question:
Is there a way to make SQL server "listen", or emulate an "interrupt"
to other requests while in the middle of a long intensive process?

I really appreciate your replies.
Thank you,
Oleg.


Begin transaction followed by temporary table creation may lock the tempdb
until the transaction is committed.
Jul 20 '05 #3
Hi Ian,
I tried using a permanent table instead of a temp one, truncating it
before the transaction, but it did not solve the problem...
Please see a more detailed description of my setup in a reply to Simon.
Thanks!
Oleg.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4
Hi Simon,
I have the following setup: There's a machine running IIS 5 and the
Application server with a CRM website; they're using a SQL 2000
database, located on a different
machine. The website is using the App server to interact with the SQL
server.
"Stops responding" means that no database-related action can be
performed on the website while this insert process is running. I tried
opening pages that are not in any way using the tables I'm inserting
into so it doesn't look like the problem is due to table locking. During
the process, IIS is not transmitting anything back to the user except
for status of the job when it's done, but until then a page i'm opening
basically hangs...
When I run the process, CPU utilization on the IIS machine is 1-2%, but
on the SQl machine it jumps up to 50-60%.
What puzzles me is that I tried running some queries right on the SQL
machine while it's running my large insert, and I do get results. So it
seems like the Queries which the APP server is requesting to run are
blocked, but other users can still use SQL server.
The more I dig into it, the more it seems like the problem is not in SQL
server, but in the App server.

Thanks very much for your suggestions.
Oleg.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #5
Oleg Berfirer <ob******@excite.com> wrote in message news:<3f*********************@news.frii.net>...
Hi Simon,
I have the following setup: There's a machine running IIS 5 and the
Application server with a CRM website; they're using a SQL 2000
database, located on a different
machine. The website is using the App server to interact with the SQL
server.
"Stops responding" means that no database-related action can be
performed on the website while this insert process is running. I tried
opening pages that are not in any way using the tables I'm inserting
into so it doesn't look like the problem is due to table locking. During
the process, IIS is not transmitting anything back to the user except
for status of the job when it's done, but until then a page i'm opening
basically hangs...
When I run the process, CPU utilization on the IIS machine is 1-2%, but
on the SQl machine it jumps up to 50-60%.
What puzzles me is that I tried running some queries right on the SQL
machine while it's running my large insert, and I do get results. So it
seems like the Queries which the APP server is requesting to run are
blocked, but other users can still use SQL server.
The more I dig into it, the more it seems like the problem is not in SQL
server, but in the App server.

Thanks very much for your suggestions.
Oleg.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


As you say, if you can get results by querying the database directly,
then your issue is most likely caused by whatever the app server is
doing. I would use Profiler to trace the SQL coming from the app
server, so you can see exactly what's happening at the time it's
blocked. That should give you some more information to help
investigate the problem.

Simon
Jul 20 '05 #6

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

Similar topics

19
by: Jane Austine | last post by:
As far as I know python's threading module models after Java's. However, I can't find something equivalent to Java's interrupt and isInterrupted methods, along with InterruptedException....
0
by: Laura Arbilla | last post by:
We are running Postgres 7.3 on a Debian Linux system. Our python web application uses psycopg to talk to the Postgres server. Our problem is that our queries can be on millions of records of data...
7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
1
by: Pavel | last post by:
I have SQL 2000 and need to retrieve fairly large amout of data (~ 50.000 characters) in XML format and then insert it into the field of the text type. As 'FOR XML' can't be used with either local...
3
by: nicolas.bouchard | last post by:
I am developing an integration process between two databases. One of them is a SQL Server 2000 and the other is using MSDE 2000. The integration process is done in C# (VS2003). The main database...
10
by: Enrique Cruiz | last post by:
Hello all, I am currently implementing a fairly simple algorithm. It scans a grayscale image, and computes a pixel's new value as a function of its original value. Two passes are made, first...
3
by: Dmitri | last post by:
Hello! I have a developer that is playing around with some SQL statements using VB.NET. He has a test table in a SQL 2000 database, and he has about 2000 generated INSERT statements. When the...
6
by: surfivor | last post by:
I may be involved in a data migration project involving databases and creating XML feeds. Our site is PHP based, so I imagine the team might suggest PHP, but I had a look at the PHP documentation...
10
by: nflacco | last post by:
I'm tinkering around with a data collection system, and have come up with a very hackish way to store my data- for reference, I'm anticipating collecting at least 100 million different dataId...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.