Practical Reporting Queries with CROSS APPLY (Part 3)
This article continues the series on APPLY, showcasing how some practical reports can be implemented using this operator.
2026-09-18
3,384 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
2026-09-11
1,514 reads
Learn how the bitwise functions SET_BIT() and GET_BIT() can be used to manage data stored inside a single column.
2026-09-11
2,465 reads
2026-09-09
1,370 reads
2026-09-07
1,648 reads
This guide covers how TRANSLATE() works, how it compares to REPLACE(), and where it falls short compared to other SQL dialects like PostgreSQL and Oracle.
2026-09-04
The following script creates a procedure that returns a specified number of random columns and rows from a specified table or view. The number of columns and rows is determined by the @NumberOfColumns and @Rows parameters. The @RandomColumnOrder parameter specifies whether the selected columns are returned in random order or sorted by their ordinal position […]
2026-08-31
129 reads
Wanna play some Texas Hold ‘Em style poker and make a pile of Query Bucks? Wanna watch other database people playing?
2026-08-26
2026-08-26
902 reads
Introduction When designing the tables or writing the stored procedures in SQL Server, we get easily tempted to choose the path of least resistance. When deciding how much space to allocate for a text column in a database table which may contain the description of a product, a product name, or an additional comment/remarks, it […]
2026-08-24
8,186 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