473,806 Members | 2,771 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3516
ob******@excite .com (Oleg Berfirer) wrote in message news:<27******* *************** ****@posting.go ogle.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******@excit e.com> wrote in message
news:27******** *************** ***@posting.goo gle.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.


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******@excit e.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
6498
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. "somethread.interrupt()" will wake somethread up when it's in sleeping/waiting state. Is there any way of doing this with python's thread? I suppose thread interrupt is a very primitive functionality for stopping a blocked thread.
0
1591
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 and take a long time. At times, the user (of the web app) loses interest in waiting for the results. I can have the web app move on, but the postmaster process which is taking care of the request stays around until it completes. When we have...
7
12132
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 servers using sp_addlinkedserver on both database servers. When I call the Commit API of oledb I get the following error: Error state: 1, Severity: 19, Server: TST-PROC22, Line#: 1, msg:
1
1793
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 variables, INSERT INTO or SELECT INTO this makes "XML support" quite useless in many aspects. Can anyone please help me in solving this. Thanks a lot for your help and time. Pavel
3
21873
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 is the SQL Server, the MSDE will contain a really small subset of the data found on the main. To help diminish the amount of time taken to develop an integration process between those databases, the same structure are found on both side. The only...
10
5748
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 horizontally and second vertically. The problem I have is that the vertical pass is 3 to 4 times slower than the horizontal, although the code is _exactly_ the same in both cases?! The code itself is very simple. There are 2 loops to scan through...
3
6604
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 2000 INSERT statements are run in SQL query analyzer, all 2000 rows are added to the table. When he tries to send the 2000 statements to SQL Server through his app., a random number of statements do not get executed. But, SQL Profiler shows that...
6
3016
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 for one of the Pear modules for creating XML and it didn't look like much. I've used Perl XML:Twig and I have the impression that there is more Perl stuff available as well as the Perl stuff being well documented as I have a Perl DBI book, a Perl...
10
2872
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 whatevers per year, possibly much more. ---366 data tables ( one for each day of the year ), each row being assigned a unique DataId ( unique across all 366 tables too ) ---100 data_map tables, table 0 having all DataIds ending in 00, table 99...
0
9598
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10623
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10371
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10373
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6877
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5683
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3852
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.