Tracking Inserted, Updated, and Deleted Rows with SQL Server OUTPUT
Learn how you can use the OUTPUT clause to capture data that is changed by your DML statements.
2026-11-16
1,952 reads
Learn how you can use the OUTPUT clause to capture data that is changed by your DML statements.
2026-11-16
1,952 reads
How do you keep some duplicate records by not others? An interesting business rule enforced by cleanup and a filtered index.
2026-11-11
1,713 reads
This article looks at some common query patterns that cause performance issues and provides some guidance on how to fix them.
2026-11-02
3,059 reads
In part 4 of this series, we look at using CROSS APPLY to filter in a function.
2026-10-19
1,843 reads
Many systems expect a sequential range of numbers for invoices, ticket numbers, and more. Learn how you can identify where you have gaps in your sequences.
2026-09-21
3,989 reads
This article continues the series on APPLY, showcasing how some practical reports can be implemented using this operator.
2026-09-18
3,384 reads
In Part 2 of this series we learn how OUTER APPLY can be used in your queries to return data, even when there are no matches between tables.
2026-08-12
3,571 reads
Learn the basics of the CROSS APPLY operator with a few examples in this short piece.
2026-07-27
6,816 reads
Introduction When developers first learn SQL aggregation, they usually start with the GROUP BY clause. It works well for summary reports because it combines multiple rows into a single result for each group. For example, you can calculate total sales per region or average salary per department. The limitation of GROUP BY appears when you […]
2026-06-05
4,795 reads
Learn a quick way to calculate distances without resorting to spatial calculations.
2026-05-08
2,616 reads
By Steve Jones
I was experimenting with CHOOSE() recently after I was asked a question. In a...
By DesertDBA
I did not expect 27 responses to my T-SQL Tuesday #204 invitation, but it...
Should you adopt an off-the-shelf AI tool, partner with a specialist, build in-house, or...
Has anyone ever seen this before? I have sysadmin permission on a server. I...
Comments posted to this topic are about the item Switching Schema II
Comments posted to this topic are about the item A Practical Approach to Automating...
I run this query:
SELECT s.name AS schemaname , o.name AS objectname FROM sys.objects o INNER JOIN sys.schemas s ON s.schema_id = o.schema_id WHERE o.name = 'Beer'I get two rows back for the objects, named dbo.beer and etl.beer. Both the tables have identical schemas and are not partitioned. There are 25 rows in dbo.beer and 0 rows in etl.beer. I run this code:
ALTER TABLE dbo.beer switch TO etl.beerWhat happens? See possible answers