Martin , I think my insert_recordset is perfectly fine , Because when running SSRS report , It's working perfect , correct data is showing up .
If my query had issues , It would not have sent reports to 20-30 customers ..
But when I am looping through each customer , it's working fine for 20-30 customers , After that the query or connection is stucked with the details above..
Previously I was using setConnection(this.parmUserConnection) , when I was using local buffer of temp table , Now I removed the local buffer code and setConnection , It's working for only 20-30 customers , After that it gets stucked ..
And I didn't understand your statement " DB sync and index rebuild at same time " ?
I don't have indexes on tempdb table .