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
Matched drawer components await fitting beside preserved original materials.

SQL SERVER – Attach a Database with T-SQL

December 18, 2020
Pinal Dave
SQL Tips and Tricks
In-Memory OLTP, SQL Backup and Restore, SQL Scripts, SQL Server

To attach a Database with T-SQL, I use CREATE DATABASE … FOR ATTACH. A customer asked about attaching existing data and log files.

Read More
Gouache painting of a muffin tin holding one seashell in each cup with one vermilion shell

Capture sp_who2 Output Into a Table With INSERT EXEC

December 17, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Monitoring, SQL Scripts, SQL Server, Temp Table

To capture sp_who2 output, create a table with matching columns and fill it with INSERT EXEC. This post builds the table, captures the session list three times with a time stamp, and shows the two errors that stop the method.

Read More
Gouache painting of a leaf under an old brass magnifying glass and a new lens with a vermilion rim

DMV Version of sp_who2: A Cleaner Session List

December 16, 2020
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Monitoring, SQL Performance, SQL Scripts, SQL Server

A DMV version of sp_who2 returns the same session details from documented views and leaves out the system tasks. This post builds the query, shows why the old spid above 50 filter fails, and stores the result in a temporary table.

Read More
line numbers

Line Numbers for SSMS Efficiency – SQL in Sixty Seconds #147

December 15, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Server, SQL Server Management Studio

This is when the line numbers in SSMS comes in extremely handy and let us learn in today’s blog post how we can do that. Let us learn today.

Read More
A hand pausing on a dusty draw-stop of an old church organ, the other stops polished from use

Finding Old Agent Jobs Not Run in Months or Never Scheduled

December 14, 2020
Pinal Dave
SQL Tips and Tricks
DBA, SQL Scripts, SQL Server Agent, SQL System Table

Review agent jobs not run recently or lacking schedules, combine history and activity, and disable approved candidates for review.

Read More
Running

Slow Running Query – SQL in Sixty Seconds #146

December 11, 2020
Pinal Dave
SQL Video
Execution Plan, SQL DMV, SQL in Sixty Seconds

One of the most popular questions I receive during Comprehensive Database Performance Health Check is if I have a script that lists Slow Running Query.

Read More
Gouache painting of a white gift box tied with a vermilion ribbon bow on a pale counter

Unquoted Procedure Parameters: Are Single Quotes Optional?

December 10, 2020
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, SQL Stored Procedure

Unquoted procedure parameters work in SQL Server when the value is one plain word. This post builds a small procedure and tests which values fail without single quotes. It also shows how NULL, DEFAULT and numbers change the value.

Read More
Previous 1 … 81 82 83 84 85 86 87 … 844 Next
  • Books
  • Testimonials
  • Privacy Policy

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