Following good practice saves wasted time down the line.
TweetG’day,
Sometimes I come across what I call unusual coding practices. Developers usually have pressure on them to deliver and this...
2020-03-03 (first published: 2012-09-10)
2,387 reads
TweetG’day,
Sometimes I come across what I call unusual coding practices. Developers usually have pressure on them to deliver and this...
2020-03-03 (first published: 2012-09-10)
2,387 reads
G’day,
I been asked a few times lately the best way to generate INSERT statements.
I’d always replied to use SSMS.
I know...
2020-03-03 (first published: 2019-02-02)
2,561 reads
Another SQL Saturday Rochester is in the books - our eighth over the past nine years. Unlike past years, I actually am going to recap the event! Ray Kim...
2020-03-03
15 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
With Fabric Mirroring, Microsoft is promoting a nice and appealing story for operational reporting...
If you’ve been watching AI roll through the data community and thinking, “this seems...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Hi All I am trying to find 'bad' characters that users might type in....
Comments posted to this topic are about the item Extreme DAX: Take your Power...
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