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
The ten people of a staff table as an indented tree with a level number on each row, from Maya at level 1 down to Ben at level 5, beside the three parts of the recursive CTE: the anchor, the recursive member and the stop

Hierarchical Query Using a Recursive CTE: Levels, Order and Loops

April 24, 2012
Pinal Dave
SQL Tips and Tricks
CTE, SQL Scripts, SQL Server

A hierarchical query using a recursive CTE walks a table that points at itself, one level at a time. This post builds the levels of a small staff table with Lvl + 1, sorts the tree so each person sits under their boss, walks upward from one person and stops a loop in the data. Every result comes from SQL Server 2025.

Read More
The sentence Tom needs read access to the Budget table split into a principal (Tom), a permission (SELECT) and a securable (Finance.Budget), above the statement GRANT SELECT ON Finance.Budget TO Tom

Securables and Principals in SQL Server: Who Gets Which Permission

April 23, 2012
Pinal Dave
SQL Tips and Tricks
Schema, SQL Scripts, SQL Server, SQL Server Security

Securables and principals are the two nouns of SQL Server security, and a permission joins them. This post gives a user named Tom access to a Finance table, then uses GRANT, DENY and REVOKE and reads the permission list after each step. It ends with one grant on a whole schema. Every result comes from SQL Server 2025.

Read More
SQL SERVER - Working with FileTables in SQL Server 2012 - Part 3 - Retrieving Various FileTable Properties

SQL SERVER – Working with FileTables in SQL Server 2012 – Part 3 – Retrieving Various FileTable Properties

April 21, 2012
Pinal Dave
SQL Tips and Tricks
Filestream, SQL Scripts, SQL Server

Part 3 of my FileTables series for SQL Server 2012: queries to tell files from folders and find root paths, path locators and relative paths.

Read More
A pile of washed white laundry turned pink, a hand holding up the single red sock that caused it.

Finding the Worst Query in Five Minutes With Query Store

April 20, 2012
Pinal Dave
SQL Performance
Query Store, SQL CPU, SQL Performance, SQL Server

Find the worst query with Query Store totals, compare CPU and duration over the last day, inspect plans, and choose the first tuning target.

Read More
Three porch hooks: a flowering basket, a basket of bare soil, and one empty hook with nothing on it.

JSON_PATH_EXISTS and Typed ISJSON in SQL Server 2022

April 18, 2012
Pinal Dave
SQL Tips and Tricks
JSON, SQL Constraint and Keys, SQL Function, SQL Server, SQL Server 2022

Validate payloads with JSON_PATH_EXISTS and typed ISJSON in SQL Server 2022, distinguish null from missing, and enforce a clear contract.

Read More
cheatsheet

SQL SERVER Cheatsheet – Released for SQL Server 2012 Edition

April 17, 2012
Pinal Dave
SQL Tips and Tricks
Cheatsheet, SQL Documentation, SQL Download, SQL Server

The SQL SERVER Cheatsheet is updated for SQL Server 2012, now with SSMS shortcuts, Columnstore Index, and the datetime, ranking and analytic functions.

Read More
A whole flowering branch grafted onto a new limb of an apple tree, the joint wrapped in red tape

Building an Org Chart Query With hierarchyid

April 13, 2012
Pinal Dave
SQL Tips and Tricks
CTE, SQL Datatype, SQL Index, SQL Server

Build an org chart with hierarchyid, query descendants and levels, move a team safely, and compare it with recursive queries.

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

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