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 fixed rail guides a cart along a winding route despite a shorter path

How to Force Index on a SQL Server Query? – Interview Question of the Week #281

June 14, 2020
Pinal Dave
SQL Interview Questions and Answers
Clustered Index, Query Hint, SQL Index, SQL Scripts, SQL Server

Question: How to Force Index on a SQL Server Query?
Answer: I personally do not like to force an index on any query. Let us learn together.

Read More
Hands arranging a bento box with rice and a row of small matching dishes inside, its lid beside it

Shaping Query Results as JSON With FOR JSON PATH

June 13, 2020
Pinal Dave
SQL Tips and Tricks
JSON, SQL Scripts, SQL Server

Shape FOR JSON PATH output with nested objects, child arrays, null options, and wrappers, then return one complete JSON value to clients.

Read More
Gouache painting of a squirrel on a mossy stump holding a vermilion acorn, with an empty basket nearby

Give Memory Back to the OS? Why SQL Server Doesn’t

June 9, 2020
Pinal Dave
SQL Tips and Tricks
SQL Cache, SQL DMV, SQL Memory, SQL Scripts

This is a guest post by Brian Gale. It explains why SQL Server doesn’t give memory back to the OS, what the buffer pool keeps in that memory, and why max server memory needs a realistic value. Two queries show what is held right now.

Read More
Gouache painting of a market stall with two rows of sorted apples and a vermilion arrow post pointing at one row

ORDER BY a Parameter in SQL Server: CASE, Types and Plans

June 8, 2020
Pinal Dave
SQL Tips and Tricks
SQL CASE, SQL Order By, SQL Scripts, SQL Stored Procedure

To ORDER BY a parameter in SQL Server, write one CASE expression for each column and direction. This post builds the procedure, shows the type conversion and DISTINCT errors that trip people up, measures the cost of the sort that CASE forces, and compares OPTION (RECOMPILE) and dynamic SQL.

Read More
Several pairs of muddy boots show visitors arriving at the same doorway

How to Find IP Address of All SQL Server Connection? – Interview Question of the Week #280

June 7, 2020
Pinal Dave
SQL Tips and Tricks
Computer Network, SQL DMV, SQL Scripts, SQL Server

Question: How to Find the IP Address of All SQL Server Connection?

I had recently received this question during a recent consultation.

Read More
Gouache painting of a single wooden drawer with two keyholes, one holding a brass key and a vermilion key resting beside the other

Second Identity Column Workaround: Computed Column or Sequence

June 5, 2020
Pinal Dave
SQL Tips and Tricks
Computed Column, SQL Identity, SQL Scripts

A SQL Server table can have only one identity column, and a second one fails with Msg 2744. This second identity column workaround compares a computed column with a sequence, shows what each does with gaps, rollbacks and large values, and explains when to pick which.

Read More
Gouache painting of a long loaf cut into slices in a row, one slice topped with vermilion jam

Partition Function Fanout: Count Partitions in SQL Server

June 3, 2020
Pinal Dave
SQL Performance
SQL DMV, SQL Function, SQL Scripts, Table Partitioning

Count partitions in SQL Server by reading the fanout of a partition function. This post reads fanout and modify_date from sys.partition_functions, watches SPLIT RANGE and MERGE RANGE change them, and finds functions that no table uses.

Read More
Previous 1 … 37 38 39 40 41 42 43 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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