SQLSaturday Orlando Scheduled for October 7, 2023
The call for speakers is open! We’re always excited to have experienced and past speakers return (Rob Volk!), but if you’re a first time or relatively new speaker just...
2023-07-07
43 reads
The call for speakers is open! We’re always excited to have experienced and past speakers return (Rob Volk!), but if you’re a first time or relatively new speaker just...
2023-07-07
43 reads
This is documented, somewhat, but I wanted to put this down for myself, as the I don’t love the docs and they are hard to sort through. Flyway is...
2023-07-07 (first published: 2023-06-26)
139 reads
It’s time for our monthly blog party and thanks to Gethyn Ellis ( t | b) for hosting this month. Gethyn asks us for the best Career
The post T-SQL Tuesday #163...
2023-07-07 (first published: 2023-06-21)
257 reads
I blogged about Microsoft Fabric a few weeks ago, and wanted to follow up with an introduction video that covers the basics so hopefully you will understand the major...
2023-07-05 (first published: 2023-06-19)
504 reads
(for your reading pleasure, written by Jules. –ed) We have all had that sinking feeling of defeat: you’ve just finished explaining a very important and highly technical thing to...
2023-07-05 (first published: 2023-06-20)
416 reads
I was on the Data Exposed: MVP Edition show recently, talking about SQLCMD. I’ve written a few articles on the topics as well, and a blog post about setting...
2023-07-05
38 reads
This all started because I wanted to follow Tracy’s directions on setting up Ola for index maintenance in Runbooks. I couldn’t set up the automation account permissions unless I...
2023-07-03 (first published: 2023-06-15)
244 reads
I am super excited to announce that I have been selected to speak at SQL Server Live! in Orlando in November. I have selected to present two sessions, which...
2023-07-03
17 reads
I am excited to announce that I have been selected to speak for the Future Data Driven Summit 2023. This is a free online conference, on Wednesday, 27-September-2023, for...
2023-07-03
40 reads
In previous posts we've looked at a number of aspects of Always Encrypted and how it works. I think it's very useful to understand how it actually works in...
2023-07-03 (first published: 2023-06-15)
245 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