Gunney, thanks for your reply. I am coming back after six months. I was into some other project and could not look into your soln provided. Sorry about that. Now i am back in this project and need to find the soln as soon as possible. I hope you guys will help me in this regard.
You are right, i made the code so robust unnecessarily. Now i found a soln where in i need not to create temp tables for updating the values. I can directly update the table by just using update statement. But i have to create the index on this table in order to further optimize the procedure.
I have to create the index before i start my update process and drop the same index after the update process is over.
I need syntax for both creating and dropping the index as a dynamic SQL statements inside a procedure.
Please help me on this.
Vijay (Awaiting for your reply)