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
SQL SERVER - Simple Puzzle Using Union and Union All

SQL SERVER – Simple Puzzle Using Union and Union All

March 24, 2008
Pinal Dave
SQL Puzzle
SQL Scripts, SQL Utility

A simple puzzle using UNION and UNION ALL: guess the output of two short scripts before you run them. The hint is my article on UNION vs. UNION ALL.

Read More
SQL SERVER - 2005 - Find Highest / Most Used Stored Procedure

SQL SERVER – 2005 – Find Highest / Most Used Stored Procedure

March 22, 2008
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure, SQL System Table

Which stored procedure runs most often? My small SQL Server 2005 script finds the most used stored procedure, with execution count, worker time and calls per second.

Read More
Socks sorted into matched pairs on a quilt, a small pile of odd socks set apart, a hand holding up one sock.

Solving SQL Puzzles With Set-Based Thinking

March 20, 2008
Pinal Dave
SQL Puzzle
Ranking Functions, SQL Joins, SQL Scripts, SQL Server

Set-based thinking solves three SQL puzzles with grouping, anti-joins, and windows, then turns each solution into a repeatable query habit.

Read More
SQL SERVER - Add Column With Default Column Constraint to Table

SQL SERVER – Add Column With Default Column Constraint to Table

March 19, 2008
Pinal Dave
SQL Tips and Tricks
SQL Coding Standards, SQL Constraint and Keys, SQL Scripts, SQL Server

Add a NOT NULL column with a named default Column Constraint in one ALTER TABLE statement. I always name constraints instead of letting SQL Server pick one.

Read More
SQL SERVER - 2005 - Retrieve Any User Defined Object Details Using sys objects Database

SQL SERVER – 2005 – Retrieve Any User Defined Object Details Using sys objects Database

March 16, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL System Table, SQL Utility

The sys.objects catalog view has a row for every schema-scoped object, so you can retrieve any user defined object details, like foreign keys, by object type.

Read More
SQL SERVER - 2005 - Retrieve Processes Using Specified Database

SQL SERVER – 2005 – Retrieve Processes Using Specified Database

March 15, 2008
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL System Table

Jim Sz shared a quick script to retrieve processes that use a specific database from sys.sysprocesses, with spid, status, host name and login.

Read More
SQL SERVER - FIX : Error : 3702 Cannot drop database because it is currently in use - Part 2

SQL SERVER – FIX : Error : 3702 Cannot drop database because it is currently in use – Part 2

March 13, 2008
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts

Still see Error 3702, cannot drop database because it is currently in use? Why closing Management Studio works and how to find the connection.

Read More
Previous 1 … 292 293 294 295 296 297 298 … 336 Next
  • Books
  • Testimonials
  • Privacy Policy

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