Common SQL Server Problems: Invalid Length
This is another part in my series designed to offer guidance around common issues in SQL Server. Today, let’s talk about the all-too-common error: invalid length.
2026-02-04
This is another part in my series designed to offer guidance around common issues in SQL Server. Today, let’s talk about the all-too-common error: invalid length.
2026-02-04
The fourth part of Steve Jones's series on programming and manipulating strings in T-SQL dealing with numeric conversions.
2026-02-03 (first published: 2001-04-18)
9,666 reads
The fifth part of Steve Jones's series on programming and manipulating strings in T-SQL dealing with STUFF.
2026-02-03 (first published: 2001-06-21)
10,933 reads
Need to proper case names? Want a quick way to reformat a series of words? This article examines a SQL approach to quickly proper casing all words in a field.
2026-02-03 (first published: 2001-10-24)
12,682 reads
This article shows how you can deploy SQL Server Developer Edition in an AWS Kubernetes configuration.
2026-02-02
1,326 reads
This seems like the appropriate first BrentOzar.com blog post in the year 2026, eh?
2026-02-02
This article shows a technique for cleaning out older data from PostgreSQL tables using Python to follow a set of rules you create.
2026-01-30
909 reads
This article is a follow-up to SQL Server DBaaS Vulnerability: Decrypting System Code & Exfiltrating User Data, in which we saw some vulnerabilities that affected pretty much all DBaaS offerings available in the cloud. Now, we’ll look at another vulnerability that once again affects every major cloud vendor.
2026-01-30
This next article in the Fabric Modern Data Platform looks at DuckDB, an analytical database platform designed for analytics
2026-01-28
1,653 reads
Comparing strings has always been hard when we don't have great data quality. If we need exact matches, SQL Server works great. However, we often expect users to enter values without typos and know what values they want to find. Or at least know part of the string. However, matching with wildcards or partial strings […]
2026-01-28 (first published: 2026-01-16)
3,079 reads
It is Friday, the queries are running, and nobody is watching the bill. That...
By Steve Jones
Annabel retired from Redgate Software this week. Across most of my career at Redgate,...
By Tim Radney
As a SQL Server DBA with years of experience tuning production environments, I’ve seen...
Comments posted to this topic are about the item What is the Cloud?
Comments posted to this topic are about the item Changing the Schema
Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits,...
I set up a few users on my SQL Server 2022 instance.
CREATE LOGIN User1 WITH PASSWORD = 'Demo12#1' CREATE USER User1 FOR LOGIN User1 GO CREATE LOGIN User2 WITH PASSWORD = 'Demo12#2' CREATE USER User2 FOR LOGIN User2 GO CREATE LOGIN User3 WITH PASSWORD = 'Demo12#3' CREATE USER User3 FOR LOGIN User3 GOI then created a schema that one of them owned. Under this schema, I added a table with some data.
CREATE SCHEMA MySchema AUTHORIZATION User1
GO
CREATE TABLE Myschema.MyTable(myid INT)
GO
INSERT MySchema.MyTable
(
myid
)
VALUES
(1), (2), (3)
GO
SELECT * FROM MySchema.MyTable
GO
I granted rights and verified that User2 could access this table.
GRANT SELECT ON Myschema.MyTable TO User2 GO SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOThis worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3; GOWhat happens with this code?
SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOSee possible answers