2019-10-10
12 reads
2019-10-10
12 reads
2019-10-10
35 reads
In this blog post, you will get the query to “Split data into N equal groups” using SQL Server and you will also see the practical implementation of the...
2019-10-10
84 reads
In this blog post, you will get the query to “Split data into N equal groups” using SQL Server and you will also see the practical implementation of the...
2019-10-10
769 reads
WHILE LOOP can be used for batch processing and can be helpful if you are dealing with huge data processing. Recently I did an analytics project where I had...
2019-10-09
22 reads
Here’s a quick post on something simple which stumped me for a while, in the hopes that search engines help someone else who gets confused in the same way....
2019-09-02
17 reads
I’m really excited for Redgate’s new SQL Change Automation plugin for SQL Server Management Studio (SSMS). SQL Change Automation lets DBAs and developers use a migrations-first approach to create...
2019-08-26
18 reads
The Accelerate: State of DevOps Report 2019 has just been published. This report is the latest in six years of research. With more than 31,000 survey responses, Accelerate is...
2019-08-22
6 reads
This is the first in a series of posts about simple things that I had a hard time figuring out in Azure DevOps services. It can be very useful...
2019-08-19
67 reads
After almost fifteen years of heavy usage by developers and database administrators (DBAs), it might seem like Microsoft’s free tool, SQL Server Management Studio (SSMS), is about to go...
2019-08-14
16 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