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 three differently shaped tea cups on a bamboo tray beside a slate blue teapot, the small one vermilion

PRINT Date Format in SQL Server: PRINT Versus SELECT

August 23, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL String

The PRINT date format differs from the SELECT format, because PRINT converts the value to text first. This post tests PRINT with six date and time types, shows why joining text and a datetime fails with Msg 241, shows how the session language changes the month name, and gives the formats that stay the same everywhere.

Read More
Gouache painting of three windows of different shapes in a courtyard wall all showing the same vermilion flowerpot

Actual Execution Plan in SQL Server: Graphical, Text and XML

August 22, 2019
Pinal Dave
SQL Performance
Execution Plan, SQL Scripts, SQL Server, SQL Server Management Studio

An actual execution plan shows how SQL Server really ran a query, with the true row counts beside the estimates. This post gets the plan three ways, as a graphical plan, as text with SET STATISTICS PROFILE and as XML, and uses a demo table to show how the estimate and the actual number can disagree.

Read More
Gouache painting of a row of watering cans on a bench with one leaking vermilion can

IO Stalls by Database File: Find the File to Move

August 21, 2019
Pinal Dave
SQL Performance
Disk, SQL DMV, SQL Scripts, System Object

IO stalls measure how long SQL Server waited for the disk, file by file. This post ranks the files of a demo database by stall time, measures a workload with two snapshots, lists the busiest files of a whole instance, and explains how to pick the one file that belongs on the new drive.

Read More
Gouache painting of a shelf with one vermilion bucket and four more stacked aside

Remove Extra tempdb Files in SQL Server Safely

August 19, 2019
Pinal Dave
SQL Performance
SQL Scripts, SQL Server, SQL Server DBCC, SQL TempDB

To remove extra tempdb files, empty each file first with DBCC SHRINKFILE and then remove it with ALTER DATABASE. This post checks the file count and the allocation waits before you start, rehearses both steps on a demo database, shows the tempdb statements with their undo, and explains why emptying can fail.

Read More
A carved template produces the same pattern on several new clay tiles

How to Create a Table Automatically in All Newly Created Databases? – Interview Question of the Week #238

August 18, 2019
Pinal Dave
SQL Interview Questions and Answers
SQL Scripts, SQL Server, System Database

Question: How to Create a Table Automatically in All Newly Created Databases? This question was recently asked in my recent consulting engagement

Read More
Gouache painting of a small tower of round, square and triangular wooden blocks topped with a vermilion block

DATETIMEFROMPARTS Function: Build Dates From Parts

August 17, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

The DATETIMEFROMPARTS function builds a datetime value from seven numbers, with no string conversion and no language trap. This post tests how it rounds milliseconds, which parts raise an error, how it treats NULL, and how its relatives build dates, times and offsets.

Read More
Gouache painting of wheelbarrows of apples waiting in line at one apple press with the first barrow in vermilion

Runnable Sessions in SQL Server: What to Check Next

August 16, 2019
Pinal Dave
SQL Performance
SQL CPU, SQL DMV, SQL Scripts, SQL Server

Runnable sessions are sessions that have everything they need except a free CPU. This post counts requests by status, checks that SQL Server can see every processor, reads the settings that cap CPU use, and lists the statements waiting in the queue, so a long queue next to a half idle CPU stops being a puzzle.

Read More
Previous 1 … 65 66 67 68 69 70 71 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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