It is Work to Live not Live to Work
In the United States, we have our Thanksgiving this month. This is a time where families come together for a huge meal. For many, it is a time to...
2024-11-11
15 reads
In the United States, we have our Thanksgiving this month. This is a time where families come together for a huge meal. For many, it is a time to...
2024-11-11
15 reads
This article provides a comprehensive overview of the ORDER BY clause within SQL window functions. We'll explore how it interacts with PARTITION BY and the standard ORDER BY clause,...
2024-11-11 (first published: 2024-10-24)
652 reads
One of the things that many DBAs struggle with is managing space across an estate. There might be one or two servers that you watch closely, or that are...
2024-11-11 (first published: 2024-10-28)
461 reads
If you are an introvert like me, events like the PASS Summit can call forth your social anxiety. I know this past week, I definitely felt it, even though...
2024-11-11
71 reads
skidding – v. intr. the practice of making offhand comments that sound sarcastic but are actually sincere and deeply felt. I used to make lots of sarcastic comments. Some...
2024-11-08
23 reads
Let’s start with the keynote. The biggest take away was how having to support multiple data platforms is growing and becoming the norm. This has been my experience and...
2024-11-08
30 reads
I still have a tendency to talk about all the cons of a proposed solution I don’t believe is the optimal one. There’s an old saying that “no one...
2024-11-08 (first published: 2024-10-29)
171 reads
Recently a customer asked if SQL Compare and SQL Data Compare can be used with a read-only database as a source. It’s a good questions as I’ve seen some...
2024-11-08 (first published: 2024-10-21)
187 reads
A common theme in the PASS Summits I've attended is community and that's definitely true this year. It's one of the reasons I have loved coming when I can....
2024-11-07
40 reads
I am excited to cover the Microsoft Keynote on Day 2: Redgate Keynote: Simplifying Complexity – Making the Database Work in the Real World. As the database landscape grows...
2024-11-07
31 reads
With Fabric Mirroring, Microsoft is promoting a nice and appealing story for operational reporting...
If you’ve been watching AI roll through the data community and thinking, “this seems...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Hi All I am trying to find 'bad' characters that users might type in....
Comments posted to this topic are about the item Extreme DAX: Take your Power...
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