• abivenkat (1/22/2013)


    since it is going to get executed parallely by 5 threads and how can i handle the insert, delete and truncates inside the SP? will it be a problem, if more than one insert or delete or truncate queries executed at the same time, is there any collision occurs? or is there any lock functionality in SP to allow only one operation for a sql statement in SP?

    Sql server will not do it Simultaneously. it will get performed sequentially.plus you dont need to handle/worry about the DML operation , sql server wil hendle them smartly/intelligently with the help of lock mechanism. this compltete terminology called "transaction". so there will be no collision (yes there coulds be some blocking while DML operation perform but only for small intervals in normal scenario).

    You should read some articles related to

    1) transaction

    2) locks

    2) isolation level.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)