SQL Server I/O
Sometimes I like to see and know what SQL server is doing under certain operations and recently I wrote an...
2018-12-11
228 reads
Sometimes I like to see and know what SQL server is doing under certain operations and recently I wrote an...
2018-12-11
228 reads
Getting feedback from others is that little check that is needed to help progress and move in the right direction. When allowing time and opportunity for feedback from others,...
2018-12-11
13 reads
How have you impacted somebody in the community?
Well, have I come up with a doozy of a topic for this...
2018-12-11
189 reads
G’day again,
So, it’s time for T-SQL Tuesday again, the blog party
started by Adam Machanic (
This time we're talking about people...
2018-12-11
175 reads
This post is the first in a series about physical join operators (be sure to check out part 2 - merge joins, and part 3 - hash match joins).
Watch...
2018-12-11
20 reads
This post is the first in a series about physical join operators (be sure to check out part 2 – merge...
2018-12-11
963 reads
This post is the first in a series about physical join operators (be sure to check out part 2 - merge joins, and part 3 - hash match joins).
Watch...
2018-12-11
16 reads
My first data warehousing tip is to store fact data at the leaf level. If you aggregate your fact data...
2018-12-10
316 reads
Yes Virginia, there are ghosts in your database. More specifically, there are ghosts in your SQL Server database. They are...
2018-12-10 (first published: 2018-11-26)
2,561 reads
Due to threats of data loss, human errors, scam attempts, hardware damage, or natural disasters, it is imperative for IT administrators to ensure the security of data. In order...
2018-12-10
21 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