Understanding Relative Risk – with T-SQL
In this post we will explore a common statistical term – Relative Risk, otherwise called Risk Factor. Relative Risk is a...
2017-06-21 (first published: 2017-06-19)
1,970 reads
In this post we will explore a common statistical term – Relative Risk, otherwise called Risk Factor. Relative Risk is a...
2017-06-21 (first published: 2017-06-19)
1,970 reads
In 2017, there’s no excuse not to have at least a testing environment, and preferably a development environment as well,...
2017-06-21
134 reads
Microsoft announced a new program last year to help you understand the skills that a Data Scientist needs in their...
2017-06-21
478 reads
Watch this week's video on YouTube
It's 4:30 pm on Friday and Mr. Manager comes along to tell you that he needs you to run some important ad-hoc analysis for...
2017-06-20
24 reads
It’s worth noting that a lot of people will never need to create their own database. You may never create...
2017-06-20
492 reads
On the 19th of April 2017, Microsoft held an online conference called Microsoft Data Amp to showcase how Microsoft’s latest...
2017-06-20
785 reads
In this module you will learn how to use the Enlighten World Flag Slicer Custom Visual. The Enlighten World Flag...
2017-06-20 (first published: 2017-06-13)
2,032 reads
In this module you will learn how to use the Rotating Tile Custom Visual. The Rotating Tile gives you the...
2017-06-20
716 reads
I am honored to be speaking at the Data Platform Summit 2017. The event takes place August 17-19, 2017 in...
2017-06-20
562 reads
One of the new less publicized features in SQL Server 2017 is STRING_AGG. This new feature can take an expression...
2017-06-20
90 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