This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Gouache painting of a bakery board half clean and half crumbs with a vermilion pastry brush

Reclaim Space After Dropping a Column With DBCC CLEANTABLE

September 9, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Server, SQL Server DBCC

To reclaim space after dropping a column, run DBCC CLEANTABLE or rebuild the index. This post measures both on a demo table and shows that CLEANTABLE shrinks the rows while only a rebuild returns the pages.

Read More
Gouache painting of three sacks of lentils in three sizes, each with a vermilion scoop

Size and Rows of Each Table in SQL Server, Indexes Included

August 18, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL DMV, SQL Scripts, SQL Server

To list the size and rows of each table, add up the pages from sys.dm_db_partition_stats and split them into data, index and unused space. This post shows three traps in the common join query and checks the corrected result against sp_spaceused.

Read More
Gouache painting of two open trunks of quilts, one nearly full and one half empty with a vermilion quilt on top

Free Space in Database Files: Check Data and Log Files

August 16, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Server, Transaction Log

To see the free space in database files, compare each file’s size with the pages it uses. This post gives one query for data and log files, adds the free space on the drive, and checks the log figure against a second source.

Read More
Gouache painting of a row of measuring jugs at different levels with a fresh one filled through a vermilion funnel

UPDATEUSAGE and Space: What It Fixes and What It Does Not

July 26, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Server DBCC

UPDATEUSAGE and space are two jobs: the command corrects page and row counts but frees no space. See a test where it finds nothing and a rebuild shrinks the table.

Read More
Read Only Tables

Read Only Tables – Is it Possible? – SQL in Sixty Seconds #179

July 9, 2021
Pinal Dave
SQL Video
SQL Data Storage, SQL in Sixty Seconds, SQL Scripts, SQL Server

After reading it, lots of people asked me if I can make a video on this topic. Of course, here we go, Read Only Tables – Is it Possible?

Read More
Gouache painting of a plate of bread rolls under a glass dome with a vermilion knob

Freeze a Table With a Read Only Filegroup in SQL Server

July 8, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Table Operation

Freeze a table by placing it on a READ_ONLY filegroup. See what fails, how to move a table in, and how to undo it in SQL Server.

Read More
A broad compartment retaining bar protects several stored objects together.

SQL SERVER – Making Filegroup Read Only

July 7, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Server

A filegroup read-only setting prevents writes to objects stored there. A customer asked whether a table could be protected this way.

Read More
Previous 1 2 3 4 5 … 23 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com