How to Persuade Your Company to Change
Like a lot of developers and database administrators, I do a fair amount of short-term problem solving during the course of my normal work week. I get to join...
2019-07-19
11 reads
Like a lot of developers and database administrators, I do a fair amount of short-term problem solving during the course of my normal work week. I get to join...
2019-07-19
11 reads
Building your database code is an essential practice to ensure that it compiles from source and that dependencies are met. But things can get tricky when you have objects...
2019-06-25
17 reads
You’re a DBA, and your development team is all-in on doing DevOps, and they want to include the database. Should your DBA team limit the permissions or options for...
2019-06-13
9 reads
This post is a part of #tsql2sday, a monthly community ritual where a topic is proposed by a community member and everyone is invited to join in. This month’s...
2019-06-11
17 reads
I recent chatted with some folks who have a permissions problem in SQL Server. The permissions problem isn’t technical — it’s a process problem. The issue is that these...
2019-05-30
14 reads
Today I was looped in on an email thread about the pros and cons of attending a specific event. One person on the thread asked if any of us...
2019-05-21
11 reads
I recently realized that I’m in the early stages of burnout. This isn’t an unfamiliar place for me, but it is new for me to recognize the early signs...
2019-05-14
9 reads
One of the cool things that I do as an Evangelist at Redgate is to periodically visit company headquarters in Cambridge. The other Evangelists and I get to meet...
2019-05-07
7 reads
Today I got a bit closer to a meaningful definition of automation, as it applies to the software development process. I’ve been turning this concept over in my head...
2019-04-29
17 reads
I got a question recently about a panel discussion on Database Development Disasters at SQL in the City Streamed. I had framed a question as, “how fast should development...
2019-04-23
10 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