UNION removes duplicate rows like SELECT DISTINCT, while UNION ALL keeps them all. My early notes on Union vs. Union All, with a link to the rewritten post.
SQL SERVER – ReIndexing Database Tables and Update Statistics on Tables
ReIndexing Database tables with DBCC DBREINDEX and sp_MSforeachtable, then sp_updatestats to refresh statistics. Two scripts, including the one I prefer.
SQL SERVER – Shrinking Truncate Log File – Log Full
The old code I used to truncate log file space with DBCC SHRINKFILE and BACKUP LOG WITH TRUNCATE_ONLY. It breaks the log chain, so take a full backup after.





