Collation Conflicts in a SQL Server Join
I went to run this query recently:
select TOP 10 *
from users a
inner join Banned b
on a.username = b.usernameand...
2011-05-23
4,406 reads
I went to run this query recently:
select TOP 10 *
from users a
inner join Banned b
on a.username = b.usernameand...
2011-05-23
4,406 reads
This week Steve Jones reminds us that improving performance in T-SQL is not always obvious. Those little nuggets of knowledge can be very handy, which is why you should be regularly looking to acquire more of them.
2011-05-23
183 reads
This Friday Steve Jones wonders what types of bugs you find in software. Are there more prevalent because of design or coding?
2011-05-20
138 reads
2011-05-20
2,266 reads
This is a powerful quote:
“This is the digital world IT must keep up with–one where Apple can view a...
2011-05-19
744 reads
2011-05-19
2,691 reads
I’m in a fun mood today, so a few silly items for you.
The last few weeks, Paul Randal (blog | @PaulRandal)...
2011-05-18
891 reads
Simon Sabin had his own take on increasing laptop speed. He had some good ideas, but he inspired me to...
2011-05-18
2,335 reads
What do yo do if you find malicious code in your system? Delete it? Steve Jones suggests that a honeypot might be a better idea.
2011-05-18
181 reads
Someone posted this query recently:
select a.*,name, b.*
from sys.database_principals a, sys.database_permissions b
where permission_name = 'INSERT'
and
b.grantee_principal_id = a.principal_idThat’s a little ugly, so let’s fix...
2011-05-17
2,242 reads
By Steve Jones
Finding duplicates was an interview question for me years ago, and I’ve never forgotten...
By HeyMo0sh
Over time, I’ve realised that one of the hardest parts of cloud management isn’t...
By HeyMo0sh
One of the biggest challenges I’ve faced in cloud operations is maintaining clear visibility...
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
Comments posted to this topic are about the item Answering Questions On Dropped Columns
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