Ad Hoc SQL Server Help
I just need a few hours of your time… We get a variation of this request a LOT. So now it’s time to do something about it! Ad Hoc...
2026-03-02
17 reads
I just need a few hours of your time… We get a variation of this request a LOT. So now it’s time to do something about it! Ad Hoc...
2026-03-02
17 reads
This isn’t a religious debate. I have a client right now debating how to handle SQL Server upgrades across all of their dev and test environments. And it’s...
2026-02-18 (first published: 2025-12-31)
417 reads
The terminology around reliability is a mess If you’ve ever said, “We’re covered, it’s replicated,” you’re in good company. SQL Server is a massive, 35+ year-old product that...
2025-11-19
20 reads
Some of the best career enhancers you can buy. Why I Go to Conferences I go for two big reasons: Learning from the best. The folks teaching at...
2025-12-01 (first published: 2025-11-12)
279 reads
If your production SQL Servers are still running 2016 (or older) you’re basically banking on inertia. Sure, it’s been stable. But that doesn’t guarantee it’ll stay safe or compliant....
2025-10-29
29 reads
It’s Not Just Backup / Restore At some point every company faces it: the SQL Server that’s been quietly running for years is due for retirement. Maybe the hardware...
2025-10-22
17 reads
Don’t Let Trouble Sneak Up on You Most SQL Servers run quietly. Until they don’t. By the time someone notices an application outage or a failed backup, you’re...
2025-11-03 (first published: 2025-10-15)
336 reads
Parts 1, 2 and 3 got you to the (SQL) engine room. Now we use community-trusted tools to find what’s going on, fix it safely, and hopefully keep it...
2025-10-07
192 reads
In parts 1 and 2 of this series, we’ve gathered info and done the triage just like anyone in almost any industry does At this point you’ve: Defined what...
2025-10-27 (first published: 2025-10-01)
1,737 reads
The 10-Minute Outside-In Triage Don’t Blame SQL First It’s 9:05 AM and your helpdesk lights up: “The SQL Server is down. Nothing works.” By 9:07, everyone is staring at...
2025-09-24
26 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