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 query results.

SQL SERVER – Effect of Order of Join In Query

August 2, 2008
Pinal Dave
SQL Performance
SQL Index, SQL Joins, SQL Scripts, SQL Server

Does the order of join in a query change the result? With AdventureWorks, I show two queries that return the same rows, only in a different order.

Read More
SQL SERVER - 2008 - Get Current System Date Time

SQL SERVER – 2008 – Get Current System Date Time

August 1, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Several ways to get the current system date time in SQL Server 2008, from GETDATE to the newer functions, with a quick video on the topic.

Read More
A brass sextant on a coil of rope on a boat deck at dawn, a red scarf tied to the rail

SQL SERVER – 2008 – Find Current System Date Time and Time Offset

July 31, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Scripts

SQL Server 2008 adds SYSDATETIMEOFFSET, which returns the current system date time along with its time offset from GMT. One line shows how.

Read More
Gouache painting of a cream wrapped gift with a red ribbon on a patio table beside a pitcher of lemonade and a paper party hat

How to Calculate Age Correctly in SQL Server

July 30, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Calculate Age in SQL Server by counting completed birthdays, not calendar years. This post compares DATEDIFF, a DATEADD correction and a compact integer version on a bike club table, handles February 29 birthdays and ends with a reusable function for age on any date.

Read More
SQL SERVER - SQL SERVER - Simple Example of Recursive CTE - Part 2 - MAXRECURSION - Prevent CTE Infinite Loop

SQL SERVER – SQL SERVER – Simple Example of Recursive CTE – Part 2 – MAXRECURSION – Prevent CTE Infinite Loop

July 29, 2008
Pinal Dave
SQL Tips and Tricks
CTE, SQL Joins, SQL Scripts

Can you stop a recursive CTE from running forever? Yes. Use the MAXRECURSION option to limit it, and see what happens when the limit is too low.

Read More
SQL SERVER - Simple Example of Recursive CTE

SQL SERVER – Simple Example of Recursive CTE

July 28, 2008
Pinal Dave
SQL Tips and Tricks
CTE, SQL Joins, SQL Scripts

A simple example of Recursive CTE in SQL Server, using AdventureWorks to walk the hierarchy of managers and employees, with each part explained.

Read More
SQL Object Explorer results window.

SQL SERVER – mssqlsystemresource – Resource Database

July 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL System Table

What is mssqlsystemresource? It is the Resource Database, a read only database of system objects that makes upgrading SQL Server much easier.

Read More
A thick open book with a vermilion ribbon bookmark deep in its pages, reading glasses resting on it under a lamp.

Pagination With OFFSET and FETCH

July 26, 2008
Pinal Dave
SQL Performance
SQL Index, SQL Order By, SQL Paging, SQL Server

OFFSET and FETCH make page-number queries readable, but deep pages scan past prior rows; keyset pagination keeps the next page focused.

Read More
A long pale wooden plank over a triangular support, beside a red wooden cube.

NULLIF Denominators: Keep Zero and Missing Values Visible

July 25, 2008
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL NULL, SQL Server

NULLIF denominators turn zero into NULL for a deliberate division policy. This complete example keeps zero, missing inputs and integer truncation visible beside the decimal result.

Read More
SQL SERVER - DBCC SHRINKFILE Takes Long Time to Run

SQL SERVER – DBCC SHRINKFILE Takes Long Time to Run

July 25, 2008
Pinal Dave
SQL Performance
SQL Server DBCC

Why does DBCC SHRINKFILE take so long when index rebuilds run faster? It is single threaded. Rebuild indexes first and the shrink takes less time.

Read More
Previous 1 … 522 523 524 525 526 527 528 … 590 Next
  • Books
  • Testimonials
  • Privacy Policy

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