Greg Larsen

Greg started working in the computer industry in 1982. In 1985, he got his first DBA job, and since then he has held six different DBA jobs and managed a number of different database management systems. Greg has moved on from being a full-time DBA and is now an adjunct professor at St. Martins University and does part-time consulting work. He has published numerous articles in SQL Server Magazine, and many online web sites dedicated to SQL Server. He is a former SQL Server MVP and holds a number of Microsoft Certification. Greg can be reached at gregalarsen@msn.com.

Follow Greg Larsen via

26 June 2023
26 June 2023

Using a Subquery in a SELECT statement

Did you know you can include a SELECT statement within another SELECT statement? When a SELECT statement is embedded within another statement it is known as a subquery. There are two types of subqueries: basic subquery and correlated subquery. In this article I will be discussing both types of subqueries and will be providing examples … Read more
06 February 2023
06 February 2023

Using TOP clause in a SELECT statement

There might be a time when you might want to return just a few rows of a result set, instead of the complete set. This might be useful if you want to just validate a selection criteria or a few rows of data. For whatever the reason the TOP clause can be used to return a specific number or a percentage of rows from a result set. This article will cover using the TOP clause in a SELECT statement and how it can be used to return a partial set of records.… Read more
17 January 2023
17 January 2023

Manage Data Over Time with SQL Server MERGE Statement

Once data is in a table it needs to be maintained. New records will need to be added, and existing records will need to be updated, and/or deleted. To keep data maintained, the insert, update or delete actions may need to be performed. This article will show how those three data manipulation language (DML) actions can be synchronized together within a single basic MERGE statement.… Read more
07 November 2022
07 November 2022

The Basics of Deleting Data from a SQL Server Table

Over time data in SQL Server tables needs to be modified. There are two major different aspects of modifying data: updating and deleting. In my last article “Updating SQL Server Data” I discussed using the UPDATE statement to change data in existing rows of a SQL Server table. In this article I will be demonstrating … Read more