2026-11-18
237 reads
2026-11-18
237 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
2026-11-13
1,062 reads
2026-11-11
806 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
Adding a column is relatively easy, since the applications can just ignore it in most cases. But taking a column away can be a little bit more work, as you may have to trick the applications into believing the column is still there. I often see systems where deprecated columns have stayed around “forever” — because people are too afraid to remove them, or because they don’t have the access or capability to modify the source code of the affected applications.
2026-11-09
2026-11-09
1,229 reads
Some systems store several small status values through a single packed integer. For example, a device integration may require tracking operating mode, alert level, and zone information as one status code rather than separate values in different columns. That creates a practical reporting problem. The packed value may be convenient for an integration format, but […]
2026-11-06
1,770 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
Learn how to use CHOOSE() and IIF() to validate priorities and return easy to read messages to the user.
2026-10-21
2,593 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