Tally Tables in T-SQL
The Tally (or Numbers) table is one of the most useful constructs in intermediate-level SQL. Have you ever written a...
2014-03-27
56,480 reads
The Tally (or Numbers) table is one of the most useful constructs in intermediate-level SQL. Have you ever written a...
2014-03-27
56,480 reads
In today’s blog I will attempt to challenge the popularly held notion that LIKE “%string%” wildcard searches must be slow...
2014-03-26
20,689 reads
In SQL Server 2005, Microsoft introduced the Common Table Expression (CTE). CTEs share similarities with VIEWS and derived tables, but...
2014-03-23
1,603 reads
If you learn one new T-SQL (i.e., Microsoft SQL Server) concept today it should be ROW_NUMBER(). Introduced in SQL 2005,...
2014-03-22
2,962 reads
When you've got only a single effective date on a record and you need to artificially create the effective end date based on a following row in T-SQL, the techniques discussed in this article will help you decide what is best.
2014-03-18
33,660 reads
Follow along as this starter article on the SQL TABLE Type walks you through the various ways it can be used in T-SQL.
2014-03-03
10,002 reads
2014-01-09
2,342 reads
A way to assign variable and overrideable defaults to input parameters to an SP or FUNCTION using a configurations table.
2013-09-03
8,356 reads
2013-09-03
2,456 reads
The SQL MERGE statement can make your DML querying more efficient but you need to take care or you may get burned
2013-04-03
24,548 reads
By Vinay Thakur
Continuing from Day 3 where we covered LLM models open/closed and their parameters, Today...
By Steve Jones
One of the nice things about Flyway Desktop is that it helps you manage...
By HeyMo0sh
Microsoft Fabric (not to be confused with the more general term “fabric” in DevOps)...
I'm fairly certain I know the answer to this from digging into it yesterday,...
Hi Team, I am trying to refresh the Azure Synapse Dedicated pool from production...
hi everyone I am not sure how to write the query that will produce...
I have some data in a table:
CREATE TABLE #test_data
(
id INT PRIMARY KEY,
name VARCHAR(100),
birth_date DATE
);
-- Step 2: Insert rows
INSERT INTO #test_data
VALUES
(1, 'Olivia', '2025-01-05'),
(2, 'Emma', '2025-03-02'),
(3, 'Liam', '2025-11-15'),
(4, 'Noah', '2025-12-22');
If I run this query, how many rows are returned?
SELECT *
FROM OPENJSON(
(
SELECT t.* FROM #test_data AS t FOR JSON PATH
)
) t; See possible answers