Skip to content

Commit 95893c3

Browse files
committed
Added a note to show about reorganizeand autocommit
1 parent 58cfffd commit 95893c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/t-sql/statements/alter-index-transact-sql.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,13 @@ PARTITION
251251
REORGANIZE a **rowstore** index
252252
For rowstore indexes, REORGANIZE specifies to reorganize the index leaf level. The REORGANIZE operation is:
253253

254-
- It locks the object using schema shared locks (Sch-S) and exclusive locks. If another session reads data using NOLOCK hint, it will bypass the REORGANIZE (REBUILD blocks all, including statements with NOLOCK hint). Statements that modify data are always blocked.
255254
- Not allowed for a disabled index
256255
- Not allowed when ALLOW_PAGE_LOCKS is set to OFF
257256
- Not rolled back when it is performed within a transaction and the transaction is rolled back.
258257

258+
> [!NOTE]
259+
> If using explicit transactions instead of the default implicit transaction mode (e.g., ALTER INDEX within BEGIN TRAN ... COMMIT/ROLLBACK), the locking behavior of REORGANIZE becomes more restrictive. For more information on implicit transactions, see [SET IMPLICIT_TRANSACTIONS (Transact-SQL)](../../t-sql/statements/set-implicit-transactions-transact-sql)
260+
259261
For more information, see [Reorganize and Rebuild Indexes](../../relational-databases/indexes/reorganize-and-rebuild-indexes.md).
260262

261263
REORGANIZE WITH **(** LOB_COMPACTION = { **ON** | OFF } **)**

0 commit comments

Comments
 (0)