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 single wooden drawer with two keyholes, one holding a brass key and a vermilion key resting beside the other

Second Identity Column Workaround: Computed Column or Sequence

June 5, 2020
Pinal Dave
SQL Tips and Tricks
Computed Column, SQL Identity, SQL Scripts

A SQL Server table can have only one identity column, and a second one fails with Msg 2744. This second identity column workaround compares a computed column with a sequence, shows what each does with gaps, rollbacks and large values, and explains when to pick which.

Read More
Gouache painting of a wicker trunk half packed with neat folded blankets and a vermilion strap left half buckled

Kill a Running Shrink: Is It Safe to Stop DBCC SHRINKFILE?

June 4, 2020
Pinal Dave
SQL Tips and Tricks
Shrinking Database, SQL Performance, SQL Server DBCC

You can kill a running shrink with KILL and the database stays safe. This post starts a shrink on a test database, stops it from a second window, checks the data and the file afterwards, and shows that the shrink itself, not the kill, is what fragments the table.

Read More
Gouache painting of a long loaf cut into slices in a row, one slice topped with vermilion jam

Partition Function Fanout: Count Partitions in SQL Server

June 3, 2020
Pinal Dave
SQL Performance
SQL DMV, SQL Function, SQL Scripts, Table Partitioning

Count partitions in SQL Server by reading the fanout of a partition function. This post reads fanout and modify_date from sys.partition_functions, watches SPLIT RANGE and MERGE RANGE change them, and finds functions that no table uses.

Read More
rowssampled

SQL SERVER – Rows Sampled – sys.dm_db_stats_properties

June 2, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Scripts, SQL Server, SQL Server DBCC, SQL Statistics

Here is the question asked in my yesterday’s Comprehensive Database Performance Health Check about rows sampled from sys.dm_db_stats_properties.

Read More
Separate pattern guides retain individual thread bundles for inspection rather than one combined change total.

SQL SERVER – Statistics Modification Counter – sys.dm_db_stats_properties

June 1, 2020
Pinal Dave
SQL Performance
SQL DMV, SQL Scripts, SQL Server, SQL Server DBCC, SQL Statistics

The Statistics Modification Counter tracks changes relevant to each statistics object. I inspect it alongside the affected query and estimates.

Read More
Two matching doors belong to one building

Can a Database Have Multiple Files with Extension MDF? – Interview Question of the Week #279

May 31, 2020
Pinal Dave
SQL Interview Questions and Answers
SQL Data Storage, SQL Scripts, SQL Server

Question: Can a Database Have Multiple Files with Extension MDF?

Answer: Yes. It is possible to have multiple files with extension MDF.

Read More
A hand with sugar tongs dropping a sugar cube into each of a long row of teacups, the sugar bowl nearly empty.

Scalar Function Statistics With sys.dm_exec_function_stats

May 30, 2020
Pinal Dave
SQL Performance
SQL DMV, SQL Function, SQL Performance, SQL Server

Read dm_exec_function_stats to rank scalar UDF activity, inspect callers, verify collection settings, and recognize inlined work.

Read More
Previous 1 … 113 114 115 116 117 118 119 … 849 Next
  • Books
  • Testimonials
  • Privacy Policy

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