Benefits for Some, All or Only a Few
As a member of the PASS Board of Directors I attended the PASS Business Analytics Conference (BAC) recently. You can...
2015-04-27
518 reads
As a member of the PASS Board of Directors I attended the PASS Business Analytics Conference (BAC) recently. You can...
2015-04-27
518 reads
It’s been a pretty interesting month on the board.
First, we did have a little problem. I’m sure one or two...
2015-04-23
527 reads
The question came up on SQL Server Central that someone wanted to track queries on their 2008R2 instance and on...
2015-04-21
627 reads
I spend many of my evenings researching and writing. Sometimes it’s writing new books. Sometimes it’s fixing and rewriting old...
2015-04-16
684 reads
The new portal for managing Azure is pretty. I’m not sure I’m in love with it, but it’s pretty.
However, one...
2015-04-24 (first published: 2015-04-13)
5,250 reads
I decided in January that I would write regularly about people that I’m grateful for. Now it’s April. Oops.
The concepts...
2015-04-10
532 reads
If you’re starting the process of moving your databases in Azure SQL Databast to v12, you need to do one...
2015-04-07
2,066 reads
I’ve posted previously about how a foreign key constraint can change how a SELECT query behaves. Logically that just makes...
2015-04-16 (first published: 2015-04-06)
7,520 reads
One of my favorite events of the year is the SQL Saturday in Silicon Valley. They’ve had four of them...
2015-04-03
605 reads
Hello all,
It’s been a while since my last update. Sorry. I’ve just been traveling and presenting and working on books...
2015-03-31
1,099 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 Extreme DAX: Take your Power...
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
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