Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Insert of data getting missed/duplicated while using Cursor

$
0
0

Hi all,

Greeting !!

I got a strange issue with cursor usage in a SP . Below is the cursor detail.

Basicially the SP pulls around 2,25,000 records to a temp table(#TMP_ADJ) from there cursor picks and inserts to a physical table(B_SHEET) with some conditions.

Recently we are facing issues in records getting inserted to B_SHEET , the strange part is if this SP is called in a specific period of time i.e every day this job runs at 2 PM GMT and we encountered some of the records getting missed to insert in to B_SHEET table and some time the record is getting duplicated. Around 200-300 records are getting missed.

we retriggered i.e ran the SP again but this time it was fine, so we confrim that there is no issue with data.

Later we postponed the same job to get triggered at 3 PM GMT post which we dint encounter the problem.

Tough this seems to be not a problem with cursor logic, but i need experts help to identify the exact issue what happens at when the job is triggered at 2 PM GMT.

There has been no change recently done on the SP and the same SP was running fine for past 3-4years.

1 . What are the checks that needs to be done that affects CURSOR.

 DBA has confirmed that CPU utilization / temp db memory are fine during the period of time. And no issues with Data since the second run of the same SP is fine.

Thanks.


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>