Upcoming full day training: “How to Architect Successful Database Changes”
I’m excited to be teaching a full day session with Steve Jones at the SQL PASS Summit on Tuesday, November 5, in Seattle. Steve and I will be discussing...
2019-04-19
5 reads
I’m excited to be teaching a full day session with Steve Jones at the SQL PASS Summit on Tuesday, November 5, in Seattle. Steve and I will be discussing...
2019-04-19
5 reads
Calling all Database Administrators, Developers, Analysts, Consultants, and Managers: Redgate has a survey open asking how you monitor your SQL Servers. Take the survey before April 5, 2019. Your...
2019-03-19
21 reads
This morning, I received the following question from a user: Hello Madam, Could you please clarify SQLServer “Data Row” size: If I run the script below on SQL Server...
2019-03-19
21 reads
I’ve recently published an article, “Why You Shouldn’t Hardcode the Current Database Name in Your Views, Functions, and Stored Procedures,” over on Simple Talk. In the article, I discuss:...
2019-03-18
11 reads
Are you interested in speaking at the Professional Association for SQL Server’s annual Summit conference? The call for speakers is now open, and you may submit up to three...
2019-03-13
8 reads
Redgate is building a library of real-world stories about database development disasters. Your mission: Tell us a true story in 500 words or less about a time when you...
2019-03-12
13 reads
I love breaking technology. Well, I love breaking technology on purpose, in a place where it’s not going to slow anyone else down. It’s a great way to learn...
2019-03-04
9 reads
I’m excited to have just clicked ‘publish’ on four new videos in the brand new Evangelist Tutorials playlist on Redgate’s YouTube channel. These videos step through setting up and...
2019-02-15
14 reads
I’ve been working as an Evangelist at Redgate for close to six months now, and one question keeps coming up: what exactly does an Evangelist do at a software...
2019-01-29
17 reads
One controversial topic in database development is how to properly store and deploy database changes. This is generally described as choosing between two options, which are approximately as easy...
2019-01-23
18 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...
WhatsApp: 0817839777 Kw. Industri Pulogadung, Jl. Raya Bekasi Km. 21, Ruko No.A2/18-19, RW.3, Wil,...
WhatsApp: 0817839777 Jl. I Gusti Ngurah Rai No.8 A-B, RT.8/RW.6, Wil, Kec. Duren Sawit,...
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