Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6221913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:13:12+00:00 2026-05-24T08:13:12+00:00

two relating question: I have a table that is in use in a production

  • 0

two relating question: I have a table that is in use in a production or live environment. Is it appropriate and possible to begin a transaction on that table to ensure no one is using that table while it is dropped and re-generated and then committed or rolled back so that the users on live side will not notice? It may be better to delete rows and then repopulate rows. 2nd part of the question is how would I go about performing this drop or deletion of row in a transact statement, or should this be done on a tempory database table?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:13:13+00:00Added an answer on May 24, 2026 at 8:13 am

    1)to lock all table when updating you can use Table Hints (see http://msdn.microsoft.com/en-us/library/ms187373%28v=SQL.100%29.aspx), for example

    USE AdventureWorks;
    GO
    UPDATE Production.Product
    WITH (TABLOCK)
    SET ListPrice = ListPrice * 1.10
    WHERE ProductNumber LIKE 'BK-%';
    GO
    

    2)to delete all rows in table you need to use TRUNCATE TABLE. AS BOL says, TRUNCATE TABLE always locks the table and page but not each row.
    So, if somebody locks one of the record in this table, you cannot lock this table and TRUNCATE cannot begin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a question relating to the usage of this. Suppose I have two
These are actually two questions relating to an online bookstore. I have a table
I've spent two days on this and have gotten nowhere. I'm trying to use
This question comes from a need to ensure that changes I've made to code
Into I have two tables profile and name , the profile table contains some
I have a question out of curiosity relating to checking for memory leaks. Being
This is a two part question; firstly, does anyone out there have some insight
I have two comboBoxes, one that lists the 7 days of the week and
I have a function that should be passed a string with two numbers (as
I have two questions regarding client-side validation in ASP, relating to the following setup:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.