R Glen Cooper

  • Interests: SQL Server, .NET, Mathematics

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)

2021-04-19

5,810 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 (3)

2020-04-14

10,525 reads

Blogs

Daily Coping 12 Aug 2022

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

My Toolbox - Greenshot

By

Foreword A picture is worth a thousand words. I use screenshots daily, whether it’s to...

Daily Coping 11 Aug 2022

By

I started to add a daily coping tip to the SQLServerCentral newsletter and to...

Read the latest Blogs

Forums

SQL Standard Confusion

By Phil Factor

Comments posted to this topic are about the item SQL Standard Confusion

SQL Standard Confusion

By Tony Davis

Comments posted to this topic are about the item SQL Standard Confusion

Groupinig using Lists in a report

By Jason

I am trying to create a list type report and can't seem to get...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers