R Glen Cooper

Glen Cooper (r.glen.cooper@gmail.com) is a SQL Server programmer. His current interest involves graph-theoretical solutions to optimization problems. Glen holds a PhD in Mathematics specializing in model theory and symbolic logic.
  • Interests: SQL Server, .NET, Mathematics

SQLServerCentral Article

Dijkstra's Algorithm

Introduction This article celebrates a classic algorithm [1] of Dijkstra (1930 – 2002) which finds a path of minimal cost between any pair of nodes in an undirected graph. His procedure is widely recognized as a fundamental tool for examining communication and transportation networks (eg. Google Maps) and is surprisingly simple. By his own admission, […]

5 (5)

You rated this post out of 5. Change rating


7,515 reads

SQLServerCentral Article

Horizontal Trees

Introduction The sp_HorizontalTree procedure introduced here may be used to audit tables with dependent columns. A column is dependent on another if the meaning of the first column depends on the meaning of the second. For example, in a table containing accounting information, the meaning of a Fiscal Quarter column depends on the Fiscal Year to […]

You rated this post out of 5. Change rating


2,338 reads

SQLServerCentral Article

How To Avoid MERGE in SQL Server

Introduction This article shows how to script a basic merge between two tables, without using MERGE. This can be handy when you're merging a pair of tables with hundreds of columns, since the script doesn't know anything about them. This technique introduces and populates some auditing columns (IS_DELETED, IS_INSERTED, IS_UPDATED, TRANSACTION_DATE) for each record, and runs fast. […]

4.5 (6)

You rated this post out of 5. Change rating

2023-02-20 (first published: )

18,349 reads

SQLServerCentral Article

Navigating Trees With CTE

Introduction This article shows how common table expressions (CTE) in SQL Server are naturally suited for navigating trees, such as finding its longest path, or diameter. Recall that a tree is an undirected graph where unique paths exist between any two nodes (i.e. vertices). Any node may be selected as its top node, with its […]

4.8 (5)

You rated this post out of 5. Change rating


7,536 reads


Updating dbatools–Fixing the Certificate Failure


I was trying to update my dbatools install to test something and go this...

Classifications and sensitivity labels in Microsoft Purview


I see a lot of confusion on how classifications and sensitivity labels work in...

PASS Data Community Summit: A Personal Journey


As someone attending the event since 2011, I would like to share my personal...

Read the latest Blogs



By shambhumahto

Since AWS RDS MSSQL does not support logon trigger, is there any alternative way...

How to get a distinct value from my data set

By skaggs.andrew

Hi, I need help with writing a script that will allow me to pull...

How To Approach Adding A primary Key To An Existing Table

By YSLGuru

In our vendor created/managed DB we have a table that is like an audit...

Visit the forum

Question of the Day

SQL Server on Linux Restrictions

Which of these features are not available on SQL Server on Linux? (choose 2)

See possible answers