SQL statement to lock tables?

  • I have made one script to data insert in 10 tables.

    I will take half hour to run..

    I wanto to locak those table initially , so nobody can insert recoreds on those tables during running script. and after completion of script i want to release locks.

    Please give me idea for that

    _____________________________________________________________________________________________________________
    Paresh Prajapati
    ➡ +919924626601
    http://paresh-sqldba.blogspot.com/[/url]
    LinkedIn | Tweet Me | FaceBook | Brijj

  • You could use locking hints like TABLock or HoldLock. Alternatively you could set a higher transaction isolation level and do your inserts. Bear in mind that these have their own "side effects" . It would be better if you explain in detail what you want.

    "Keep Trying"

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply