R Glen Cooper

Glen Cooper is a SQL Server programmer living in the forest near Okanagan Lake in British Columbia, Canada. His current interest involves graph-theoretical solutions to optimization problems. Glen holds a PhD in Mathematical Logic (SFU).
  • Interests: SQL Server, .NET, Mathematics

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

2023-06-16

2,239 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,031 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

2021-04-19

7,066 reads

Blogs

Becoming Kristyna Ferris <3

By

Hey folks, fun personal post today. A few weeks ago, I got married! My...

What I Love About My Job

By

In June this year I took redundancy from the company I’d worked at for...

TryHackMe Advent of Cyber

By

I posted that I was thinking about the AdventOfCode this year, but wasn’t sure...

Read the latest Blogs

Forums

Backing Up Master

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Backing Up Master

Window Function Basics - PARTITION BY

By Emmitt Albright

Comments posted to this topic are about the item Window Function Basics - PARTITION...

Focus on Growth in Your Career

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Focus on Growth in Your...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers