Calculate a Moving Average with T-SQL Windowing Functions
Learn how to create a moving average in SQL Server using older and less performant T-SQL and a modern way using windowing functions.
Learn how to create a moving average in SQL Server using older and less performant T-SQL and a modern way using windowing functions.
Building software can be hard and lots of people have tried various methodologies to improve the way their teams work. Steve notes a lot of the process is the same, but he has a preference.
In this first level of the SSAS Tabular stairway, learn how to implement and format a date dimension.
Like ancient Gaul, SQL is divided into three sub- languages. The DDL (Data Declaration Language) declares the data. This is where we find the data types, constraints, references and other structures that have to do with how the data stored . The DML (Data Manipulation Language) uses those declarations to change their contents or to invoke them. It does not change structures and schema objects.
As a Data Engineer I found myself having to learn rather more about cloud infrastructure than I had expected.
I've been very pleased with the direction of SSMS the last few years. As it's been separated from SQL Server releases and gets updated more often, I think the changes from v17 though v20 have been improvements. There are still issues, but it's been better. Now we finally have SSMS moving to a modern shell […]
This article looks at how to use SQL IS NULL and SQL IS NOT NULL operations in SQL Server along with use cases and working with NULL values.
We have all heard the saying I based this week's editorial on. It has been credited to Benjamin Franklin and goes like this, “You can do anything you set your mind to”. This is such a powerful way of thinking when you are starting a task. “I can do it, no matter what anyone says.” […]
If you've ever wondered if you can do better than an INDEX SCAN when you do a LIKE "%string%" search, read on...
Steve Jones thinks that we often over-engineer software, trying too hard to consider every possibility rather than getting it close.
By Brian Kelley
I will be leading an in-person Certified Information Systems Auditor (CISA) exam prep class...
EightKB is back again for 2026! The biggest online SQL Server internals conference is...
By HeyMo0sh
Working in DevOps long enough teaches you two universal truths: That’s exactly why I...
Hi all, I just started using VS Code to work with DB projects. I...
Comments posted to this topic are about the item Fun with JSON II
Comments posted to this topic are about the item Changing Data Types
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 t1.[key] AS row,
t2.*
FROM OPENJSON(
(
SELECT t.* FROM #test_data AS t FOR JSON PATH
)
) t1
CROSS APPLY OPENJSON(t1.value) t2; See possible answers