T-SQL Tuesday 109: To influence and to be influenced
The last T-SQL Tuesday of this year is hosted by Jason Brimhall – one of my long-time friends in the SQL...
2018-12-12
125 reads
The last T-SQL Tuesday of this year is hosted by Jason Brimhall – one of my long-time friends in the SQL...
2018-12-12
125 reads
Influence Somebody Ahh, December. What a wonderful time. Snow all around (many along the eastern seaboard of the United States were hit Sunday by a snowstorm… I had 7?...
2018-12-12
10 reads
Influence Somebody
Ahh, December. What a wonderful time. Snow all around (many along the eastern seaboard of the United States were...
2018-12-12
159 reads
This has been bugging me for a while but I just haven’t had a chance to get around to revisiting...
2018-12-11
189 reads
(2018-Nov-27) When something goes wrong with your data transformation process in Azure Data Factory, the last thing you expect to happen...
2018-12-11 (first published: 2018-11-27)
9,575 reads
The question that came up during a recent class I was teaching was: What if you have a plan guide...
2018-12-11 (first published: 2018-11-26)
1,819 reads
Indexes in relational databases are very helpful and increase the speed to access data. However maintaining indexes is just as...
2018-12-11
216 reads
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the...
2018-12-11
9,389 reads
Part of having 501c(3) status is figuring out where and how it might make a difference. Applying for non profit...
2018-12-11
240 reads
The Foundry at Redgate Software is our version of Microsoft Research. Kind of. We tackle some projects that are interesting...
2018-12-11
280 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