T-SQL Tuesday #158–Implementing Worst Practices
Not that I’m looking to do this, but that’s the invitation from Raul Gonzalez this month. This is the monthly blog party where we write on a topic chosen...
2023-01-10
146 reads
Not that I’m looking to do this, but that’s the invitation from Raul Gonzalez this month. This is the monthly blog party where we write on a topic chosen...
2023-01-10
146 reads
The book Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems by Martin Kleppmann was recommended to me by a colleague. The author has worked at companies...
2023-01-09 (first published: 2022-12-29)
216 reads
Today’s coping tip is to look back at a previous coping tip that required planning and evaluate how it helped. One of my tips in December was to listen...
2023-01-09
20 reads
In this quick post we’re going to look at an additional step you should take to secure your TDE databases. This is a step you won’t find in any...
2023-01-09
35 reads
Let me start by wishing everyone the best for the year 2023! We’re going to kick off the new year with a virtual conference: the Data Community Austria Day...
2023-01-09
32 reads
In early 2022, Microsoft released a new activity in Azure Data Factory (ADF) called the Script activity. The Script activity allows you to execute one or more SQL statements...
2023-01-09 (first published: 2022-12-22)
372 reads
Today’s coping tip is to do something outdoors today. Enjoy nature. I’m writing this a few days ahead, so I’m using an activity I did over the weekend. The...
2023-01-06
19 reads
This is the goal setting post for 2023. The previous ones were: 2022 2021 2020 2019 2018 As with previous years, I’ll break these into three categories: career, personal,...
2023-01-06
21 reads
Last year I set a bunch of goals, and I thought I did pretty good working on them. Not amazing, but pretty good. This year, I want to attack...
2023-01-06
20 reads
Transparent Data Encryption (TDE) is one of the easiest ways of encrypting your data at rest. In the previous posts we looked at what TDE is and how it...
2023-01-06
93 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