2025-03-05
489 reads
2025-03-05
489 reads
The job outlook for database professionals is good, but it's not that easy to get a great job. Steve has some advice for you today.
2025-03-05
245 reads
Steve has a few thoughts on natural keys, which often turn out not to be as unique as we expect.
2025-03-03
167 reads
A recent change made to Redgate Monitor to add a new alert for VLF count. This post looks at the change. This is part of a series of posts...
2025-03-03 (first published: 2025-02-24)
326 reads
Investing small amounts of money over a long time works miracles, but no one wants to get rich slow. – from Excellent Advice for Living This is incredible advice,...
2025-02-28
23 reads
In a week I’m heading to London for the Redgate Summit. I enjoyed these last year and had some very interesting conversations with customers, prospects, and a few Redgate...
2025-02-28
19 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
Today Steve asks which data model issues are most annoying to you.
2025-02-28
140 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
2025-02-26
439 reads
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...
It is Friday, the queries are running, and nobody is watching the bill. That...
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