SQL Server Performance Forum – Threads Archive
Query causes programs to halt
Hello, I have a query that I run to copy data every half hour from my production db to my archive db. That query will get 1000’s of rows. I just completed it and tried it, and it caused my programs that were using the production database to lock up. Apparently they couldn’t get information from the db while my query was running. Is there a way to break up my query to allow my production programs time to get in and get the information they need. We’re running a high speed sorter that needs to look up barcode info and divert boxes according to the info found in the database. This needs to happen in the subsecond time frame. It works fine when my large query for transferring data is not running. Here is a small excerpt from that query: /*RecDoc selected by datetimestamp*/print ‘RecDoc’
update ArchRecDoc
set ArchRecDoc.RecDocID = ProdRecDoc.RecDocID, …rest of the columns
from [dcsterm].cryrep.dbo.RecDoc as ArchRecDoc inner join [dcsdb3].bbprod.dbo.RecDoc as ProdRecDoc on ArchRecDoc.RecDocID = ProdRecDoc.RecDocID
where ProdRecDoc.DateTimeCreated > @datetimedt insert into [dcsterm].cryrep.dbo.RecDoc select ProdRecDoc.RecDocID,…rest of the columns
from [dcsdb3].bbprod.dbo.RecDoc as ProdRecDoc
left join [dcsterm].cryrep.dbo.RecDoc as ArchRecDoc on ProdRecDoc.RecDocID = ArchRecDoc.RecDocID
where ArchRecDoc.RecDocID is null and ProdRecDoc.DateTimeCreated > @datetimedt Any help is greatly appreciated. Thanks in advance, Ben
Looks like you’re copying data to an "archive" database. Prioritize …
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by Adriaan</i><br /><br />Looks like you’re copying data to an "archive" database. Prioritize …<br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br />Bingo! [<img src=’/community/emoticons/emotion-1.gif’ alt=’


Well Frank, that was the start of the question and I kind of got lost after that.[<img src=’/community/emoticons/emotion-5.gif’ alt=’

]]>