Solved

sql2008-- index operation

Posted on 2014-01-26
2
262 Views
Last Modified: 2014-02-12
I read one of teh document for index operation in sql server, I don't understands below point by Mcsft, does it means here when I run index operation with begin or end transaction, thsi is call explicit transaction ?

4.      Do not run the online index operation in an explicit transaction. The log will not be truncated until the explicit transaction ends.

How about if I run it  below?

exec sp_MSforeachtable
  'ALTER INDEX ALL ON ? REBUILD WITH (SORT_IN_TEMPDB = ON)'
 -- force a checkpoint to reduce transaction log space used by the rebuild
 checkpoint
0
Comment
Question by:motioneye
2 Comments
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 250 total points
ID: 39811752
hi

index operations or any OTHER type of operation can be done within an EXPLICIT TRANSACTION.


an explicit transaction is when you do any sql operation within :

Begin transaction
sql...
sql...
sql...
Commit/Rollback transaction.

readup on managing transaction within sql server : http://technet.microsoft.com/en-us/library/ms188929.aspx

Aaron.
0
 
LVL 16

Assisted Solution

by:Surendra Nath
Surendra Nath earned 250 total points
ID: 39812494
You can execute the given statement within or without explicit transaction.
But putting it in a explicit transaction will reduce the performance of the index rebuild operation.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question