T-SQL Tuesday #183 Roundup
I hosted this month’s T-SQL Tuesday party with my invitation asking about tracking permissions. I didn’t get my own post completed in time, but I’ll add it in the...
2025-02-28 (first published: 2025-02-18)
243 reads
I hosted this month’s T-SQL Tuesday party with my invitation asking about tracking permissions. I didn’t get my own post completed in time, but I’ll add it in the...
2025-02-28 (first published: 2025-02-18)
243 reads
I was asked to do some a little thinking and brainstorming recently. Rather than send some emails or get on a call, I decided to ask my local AI...
2025-02-26 (first published: 2025-02-17)
361 reads
It seems like no matter how long you work with a system beyond a trivial size, you’ll find something new every so often. A little while ago, I found...
2025-02-26 (first published: 2025-02-17)
390 reads
I wrote about getting the Redgate Test Data Manager set up in 10 minutes before, and a follow up post on using your own backup. One of the things...
2025-02-24 (first published: 2025-02-12)
127 reads
(2025-Feb-12) I will jump straight to the problem statement without a "boring" introduction, which, in a sense, already feels like an opening statement.Moving data between two or more endpoints is...
2025-02-24 (first published: 2025-02-12)
463 reads
In this post, the fifth in our series, I want to illustrate an example of using the T-SQL Snapshot Backup feature in SQL Server 2022 to seed Availability Groups...
2025-02-24
137 reads
tangency– n. a fleeting glimpse of what might have been. I tend to live in the real world as it is, not too dreamy or wishful that things were...
2025-02-21
17 reads
I had to demo the Flyway Autopilot system recently and created a GitHub Actions runner as a part of that. This post documents how this went. First, if you...
2025-02-21 (first published: 2025-02-10)
227 reads
I’ve been putting together a new PostgreSQL session called “Performance Monitoring for the Absolute Beginner.” There are several ways to get an understanding of how well your queries are...
2025-02-21 (first published: 2025-02-13)
338 reads
I’m excited to be speaking at the Microsoft Fabric Community Conference this year, which takes place March 31 through April 2 in Las Vegas, Nevada. I will be co-presenting...
2025-02-20
17 reads
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
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,...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Comments posted to this topic are about the item Extreme DAX: Take your Power...
Comments posted to this topic are about the item What is the Cloud?
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