Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Does DDL affect an explicit transaction?

$
0
0

I need to rebuild a table in SQL 2000 to reclaim a huge amount of unused space. DBCC CLEANTABLE didn't help at all. I'd like to rebuild the table and with "SELECT * INTO newtable...", duplicate the index structure on the new table, and then rename the old and new tables. I need to ensure nobody else is making changing to original table while I'm rebuilding it though. (Ideally I'd like to leave it available for SELECTs if possible too).

If I enclose the entire process with a "begin transaction" at the beginning and a "commit" at the end, will that accomplish the goal? My concern is that there will be DDL executed in the middle of the process to create the indexes and Ithink that will perform an implicit commit. Is that true and if so how can I avoid it?


Chuck


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>