Level Up Your SQL Server Cross Platform Skills With mssql-scripter
The ability to export a script of database objects has for a long time been a feature of SQL Server...
2017-06-27
87 reads
The ability to export a script of database objects has for a long time been a feature of SQL Server...
2017-06-27
87 reads
The theme of day 2 of the Microsoft Data Insights Summit was sessions, sessions, sessions! There were a ton of...
2017-06-27 (first published: 2017-06-15)
2,085 reads
A couple of weeks back I blogged about my progress in the “Microsoft Professional Program in Data Science” curriculum. I’ve...
2017-06-27 (first published: 2017-06-19)
2,858 reads
I was VERY excited when I read the following tweet (below) from Bob Ward regarding SQL Server Diagnostics capability. What...
2017-06-27
583 reads
I had a strange situation the other day, where a number of things went wrong with my instance. First, I...
2017-06-26
708 reads
Previous Related Post:
Split personality text editing in SSMS with Sublime Text 3
In this prior post I wrote about how...
2017-06-26
530 reads
Last week I asked the following question on Twitter: –
I was interested to see the responses as I wanted to...
2017-06-26
350 reads
Managing indexes is a critical component of database maintenance but we often don’t think about the indicators behind the index...
2017-06-26
582 reads
Join me Friday, July 21, 2017 for a day of Real-life SQL Server Performance Troubleshooting as part of SQLSaturday Columbus...
2017-06-26
709 reads
(Be sure to checkout the FREE SQLpassion Performance Tuning Training Plan - you get a weekly email packed with all the...
2017-06-26
253 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