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.
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_Repsbegin --procedurebegin transactionblahblah.. commit transactionend --procedureIs 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 integerDECLARE MERGE_Cursor CURSOR FOR SELECT DESTINATION,SOURCE,LISTID, IDSeq FROM tmpRepMergeOPEN MERGE_CursorFETCH NEXT FROM MERGE_Cursor INTO @@TARGET_ID, @@SOURCE_ID, @@LIST_ID, @@CNTWHILE @@FETCH_STATUS = 0BEGIN 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'ENDCLOSE MERGE_CursorDEALLOCATE MERGE_CursorGO |
|
|
|
|
|
|