How can I replace the below logic for my Stored Procedure?

I have a table named TagSchema which stored information that are flattened from an XML. The data in this table is stored per item. I have to get the data from this table and process it per item. I wrote a job that takes data from this table per item and processes them. But this is very inefficient as the job at a run can process data for only one item. How can I get the data from this column and process them without using a cursor or while loop?

The columns of the TagSchema table are unitId,widgetId,value and itemId. UnitId and widgetId are referencing another table. If these values are new I have to insert them to those referencing tables. Then I have to insert the value column data per item by calling a stored procedure. This sp accepts only one item at a time.

Above is my processing logic. With the current logic, records in TagSchema table reach millions easily as it takes a lot of time. Please advice a suitable logic I could use for

August 27th, 2015 9:18pm

Please post your stored procedure(SP) , table DDL with sample data .

Maybe we can fix the SP to process all items in a time instead of using a cursor.
Free Windows Admin Tool Kit Click here and download it now
August 27th, 2015 10:22pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics