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 vessel rests for a deliberate interval while its tools remain available nearby.

MySQL – Wait For Seconds Using SELECT SLEEP()

November 15, 2021
Pinal Dave
SQL Tips and Tricks
MySQL, SQL Scripts

For a WAIT FOR test in MySQL, I use SLEEP with a bounded delay. A customer asked for the corresponding command.

Read More
Current fabric profiles are inspected beside separate preserved seasonal layers.

SQL SERVER – List All Available TimeZone

October 29, 2021
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts, SQL Server

sys.time_zone_info lists timezone names and their current offsets. My SQL Server 2019 environment returned 141 rows.

Read More
Gouache painting of a pegboard with grey tool shapes and a screwdriver with a vermilion handle lying on the bench

Last Used Stored Procedure in SQL Server: When Did It Last Run?

October 25, 2021
Pinal Dave
SQL Tips and Tricks
Query Store, SQL Scripts, SQL Stored Procedure

To find the last used stored procedure, read last_execution_time from sys.dm_exec_procedure_stats. This post tests it on demo procedures, shows why a NULL does not mean never, and adds Query Store for a longer memory.

Read More
A railway worker seen from behind tapping a goods wagon wheel with a long hammer to listen to it

Checking Last Good DBCC CHECKDB Time With LastGoodCheckDbTime

October 22, 2021
Pinal Dave
SQL Tips and Tricks
Database Corruption, DBA, SQL Scripts, SQL Server DBCC

Inspect LastGoodCheckDbTime for each database, flag stale or unavailable checks, and compare metadata with retained integrity-job evidence.

Read More
errorfix

SQL SERVER – Fix Error – Cannot execute as the database principal because the principal “dbo” does not exist

October 21, 2021
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Login, SQL Scripts, SQL Server, SQL Server Security

One of my clients recently sent me an email with the following error. The error was visible in the error log and was about the database principal. 

Read More
Gouache painting of identical stepping stones stretching into the distance from one small vermilion marker stone.

Unix Timestamp in SQL Server: Converting Seconds and Milliseconds Both Ways

October 20, 2021
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

A Unix Timestamp counts seconds or milliseconds since 1 January 1970 UTC. This post converts it to datetime2 and back on SQL Server 2025, shows why datetime2(3) keeps the milliseconds, how to pass the year 2038 limit and how time zones and dates before 1970 behave.

Read More
A usable cabinet copy stands beside a protected original and a separate recovery key.

SQL SERVER – Source Database in Restoring State

October 19, 2021
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL Server, SQL Server Management Studio

A Source Database in Restoring State can follow a tail-log backup WITH NORECOVERY. A customer encountered this while restoring another copy.

Read More
Previous 1 2 3 4 5 6 7 8 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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