From: Erland Sommarskog on 12 May 2010 03:42 fniles (fniles(a)pfmail.com) writes: > The database is pretty big at 9 gig, and the 1 of the table that I updated > has about 13 million records in it. > Will the COMMIT TRANSATION run a long time for a table this big ? The size of the table has nothing to do with it. COMMIT TRANSACTION usually completes quickly. In any case, the question is moot, because if you don't commit your changes, you will keep on blocking. >> Run COMMIT TRANSACTION in your query window until you get an error >> message, >> tell you that there is no active transaction. > What do i do when I get an error ? Stop running COMMIT TRANSACTION. > What do you mean by "tell you that there is no active transaction" ? If you say BEGIN TRANSACTION you start a user-defined transaction. Meaning that evrrything you do from that point until you commit, while either be persisted in full or not at all. Transactions are a fundamental concept in the database world. If you issue a second BEGIN TRANSACTION, that does not start a new transaction within the transaction, but it just increments a transaction counter. This is useful when working with nested stored procedures. When issue COMMIT TRANSACTION, this will only decrease the transaction counter, and nothing else happens if the transaction counter still is > 0. Therefore you need to run COMMIT TRANSCATION until you have matched all BEGIN TRANSACTION. The simplest way to verify this is to run COMMIT TRANSACTION until you get an error message telling you that there is no transaction to commit. ROLLBACK TRANSACTION, on the other hand, is different. ROLLBACK always takes effect and immediately slashes the transaction counter to 0. -- Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se Books Online for SQL Server 2005 at http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx |