Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Resource is low...

Author  Topic 

cowboisql
Starting Member

3 Posts

Posted - 2007-02-06 : 11:40:16
I have been using the following script to run a store proc stp_Merge_Reps. However, when script finish I always receive a message from SQL Query Analyzer that "Resource is low. Some resource has been dropped".

The store procedure has a begin and commit transaction block within its body which I think is the cause of this issue. eg.

Create Procedure stp_Merge_Reps
begin --procedure
begin transaction
blah
blah..

commit transaction
end --procedure


Is this the right approach for running this stp? What is a better approach? Script is below.


/* RUN Merge Package to import and build Rep Merge Table */
DECLARE
@@SOURCE_ID varchar(20),
@@TARGET_ID varchar(20),
@@LIST_ID as VARCHAR(20),
@@CNT as integer

DECLARE

MERGE_Cursor CURSOR FOR
SELECT DESTINATION,SOURCE,LISTID, IDSeq
FROM tmpRepMerge

OPEN MERGE_Cursor

FETCH NEXT FROM MERGE_Cursor
INTO @@TARGET_ID, @@SOURCE_ID, @@LIST_ID, @@CNT


WHILE @@FETCH_STATUS = 0
BEGIN

exec STP_MERGE_REPS_SP @@TARGET_ID, @@SOURCE_ID , @@LIST_ID
FETCH NEXT FROM MERGE_Cursor INTO @@TARGET_ID, @@SOURCE_ID, @@LIST_ID, @@CNT
PRINT 'RECORD ' + cast(@@CNT as char (4)) + ' completed'
END

CLOSE MERGE_Cursor
DEALLOCATE MERGE_Cursor
GO
   

- Advertisement -