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
A ravioli press fitting different fillings into separately formed pasta parcels

Survey Answers: A Table Design for Questions and Responses

April 10, 2020
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Store survey answers as typed rows instead of one column per question. Then break the design on purpose to see what it blocks and what it cannot.

Read More
A lacrosse stick transferring a ball from an unused basket toward an active basket

Counting Ranked-Choice Votes With a Loop and a Table

February 6, 2020
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Four people rank three topics and nobody has a majority. Here is a small loop that eliminates the weakest topic, moves its ballots and logs every round.

Read More
Gouache painting of a vegetable bed divided into five sections with a vermilion watering can on one divider

Get Partition Info in SQL Server: Rows and Boundaries

September 24, 2019
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL System Table, Table Partitioning

To get partition info in SQL Server, join sys.partitions to the partition scheme, function and filegroup views. This post builds a small partitioned table, lists every partition with its boundaries, row count and filegroup, and shows how to find the partition for a value. It also lists the tables that have more than one partition.

Read More
A garden path of alternating cream and blue slabs from a red slab at the gate, one slab missing by a tree root

A Schedule Table That Repeats Every Other Week

September 2, 2019
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

Build an every other week schedule in T-SQL, skip holiday dates, find the next occurrence, and check rota weeks from one anchor.

Read More
A shoulder yoke carrying one bucket of stones while a second load waits beside it

Disk Space Needed to Build a Clustered Index on a Big Table

April 11, 2018
Pinal Dave
SQL Performance
Clustered Index, SQL Table Operation, Table Partitioning, Temp Table

A clustered index build holds the old table and the new index at the same time. Here is a small demo of that peak, and what to check first.

Read More
Colored axle collars being exchanged while cotter pins and chains stay attached

Renaming a Table With Almost No Downtime Using sp_rename

March 29, 2018
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

A rename swaps names in a blink, yet the foreign key and permissions stay with the old table. Here is a short demo and a safer swap.

Read More
A stack of bamboo steamer baskets with one tier lifted out and steaming beside it.

Partition Elimination: Proving a Query Reads Only What It Needs

November 24, 2017
Pinal Dave
SQL Performance
Execution Plan, SQL Performance, SQL Server, Table Partitioning

Prove partition elimination with the actual plan, test date predicates, and use $PARTITION to check which slice SQL Server targets.

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

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