R Glen Cooper

  • Interests: SQL Server, VB.NET, mathematics

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

4,523 reads

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

9,535 reads

Blogs

Built-in Duotone Image Filter, Editor Navigation via Persistent List View, and Other Block Editor Improvements

By

The next batch of exciting updates to the block editor is live on WordPress.com....

Are You a Diverse User Group or Event?

By

One of the things that I’ve seen crop up at various points in my...

Daily Coping 18 Jun 2021

By

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

Read the latest Blogs

Forums

Deceptive Visualizations

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Deceptive Visualizations

Argument syntax for SSIS Execute Process Task Editor

By Isabelle2378

Hi, I'm trying to modify my SSIS packages to use sftp and since it...

Seeking input on Best Method to Join on First or Last Row in a 1:M Join

By YSLGuru

I have included the DDL to re-create the 2 tables in this examples. I...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers