T-SQL Tuesday #177–Keeping track of database code
This month’s invitation is from Mala Mahadevan, who has hosted 5 times. This latest one is one that is near and dear to my heart as I use source...
2024-08-13
28 reads
This month’s invitation is from Mala Mahadevan, who has hosted 5 times. This latest one is one that is near and dear to my heart as I use source...
2024-08-13
28 reads
We talk a lot about data in the data world – imagine that! Sometimes, we talk about data at rest, but when do we all rest? Do we even...
2024-08-12 (first published: 2024-07-30)
188 reads
Earlier this year, I embarked on a bit of a project to tidy up the indexes in a sizeable database. This database has over 900 tables, and there are...
2024-08-12 (first published: 2024-07-29)
435 reads
T-SQL Tuesday is a monthly blog party hosted by a different community member each month. This month, Mala Mahadevan
(blog) asks how we manage our database-related code.
Where do you keep...
2024-08-12
16 reads
As a data professional, you’ll often get a phone call, email, or trouble ticket that says “SQL Server is slow, my query is slow, or things are slow”. This...
2024-08-12
20 reads
hiddled – adj. feeling of loneliness of having to keep a secret to yourself. I don’t know I am often hiddled. I don’t tend to keep secrets by myself....
2024-08-09
32 reads
As someone attending the event since 2011, I would like to share my personal experience, the value of attending, and how the event has helped me throughout my career....
2024-08-09 (first published: 2024-07-24)
120 reads
What will the technology world look like in 2030? Cloud computing will naturally be the backbone of the world but I think with variants in “decentralising” concepts. By this...
2024-08-09 (first published: 2024-07-31)
130 reads
Doc Pop and Evan Prodromou discuss the past, present, and future of ActivityPub and the fediverse.
2024-08-09
39 reads
Why am I focussing on RWA (real world assets) as the next big thing? The WEF predicted that by 2027, 10% of the world’s GDP could be stored on...
2024-08-09
32 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