Stop #AzureDataStudio from opening a connection screen on startup
When I’m working with a tool I like a clean startup. And by that I mean don’t automatically open anything. ... Continue reading
2020-03-03 (first published: 2020-02-24)
166 reads
When I’m working with a tool I like a clean startup. And by that I mean don’t automatically open anything. ... Continue reading
2020-03-03 (first published: 2020-02-24)
166 reads
TweetG’day All,
While I was writing my last blog post about the new SQL SERVER 2012 CHOOSE statement, it also came...
2020-03-03 (first published: 2014-02-18)
13,690 reads
TweetG’day,
Are people familiar with the saying “If there’s an elphant in the room, introduce it“? – if not, then to sum...
2020-03-03 (first published: 2014-03-19)
5,438 reads
Ever since Microsoft introduced Query Store I’ve been working with it, back to the CTPs in 2016. I started presenting on it because it benefited my current company at...
2020-03-03
27 reads
I learned an interesting thing about ALTER VIEW behavior in SQL Server when applied to indexed views. This is covered in the product documentation, but it’s not something I...
2020-03-02
65 reads
The other day I saw a weird option for the UPDATE command in a stack overflow answer. Basically it looked ... Continue reading
2020-03-02 (first published: 2020-02-19)
1,902 reads
I always wanted a way to schedule commands within Azure SQL Database. Personally, for me, the go to standard is the functionality of SQL Server Agent. Obviously, this is...
2020-03-02
39 reads
The first of a double whammy of SQLSaturday Baton Rouge events over the next 5 months, SQLSatBatonRougeBI is this Saturday, March 7! The organizers of this event, from the...
2020-03-02
8 reads
Okay, the title of this blog post could also have been “SUMX returns unexpected results with duplicates”. The results only seem incorrect because an incorrect assumption might have been...
2020-03-02 (first published: 2020-02-27)
485 reads
Below is the February list of changes and updates to the Undercover Tools. Undercover Catalogue Update 0.4.2Two new modules were added to the Catalogue. Trace Flags – Capture trace...
2020-03-02
25 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