T-SQL Tuesday 177: Managing database code
I am excited to host the T-SQL Tuesday blog party for August 2024. I’ve done this many times, but I always remember when I was new to the community...
2024-08-07
49 reads
I am excited to host the T-SQL Tuesday blog party for August 2024. I’ve done this many times, but I always remember when I was new to the community...
2024-08-07
49 reads
I was trying to update my dbatools install to test something and go this error. I fixed it with a little help. The Fix The short answer from Chrissy...
2024-08-07 (first published: 2024-07-24)
609 reads
In my last article - Identify Tables With Dropped Columns - we saw how we can identify tables that have columns that were dropped. Today, we are going to...
2024-08-05
27 reads
Say we have a database that we want to migrate a copy of into Kubernetes for test/dev purposes, and we don’t want to backup/restore. How can it be done?...
2024-08-05 (first published: 2024-07-26)
367 reads
The final 2024 Redgate Summit in the US takes place in a few weeks, on Aug 21. Redgate Summit: The Database Landscape is coming to the Microsoft Office at...
2024-08-05
27 reads
We are trying to get apps and users off of using SQL accounts to access the Azure SQL DBs where I work. To make our lives easier, we are...
2024-08-05 (first published: 2024-07-25)
388 reads
bareleveling – v. trying to improve yourself without anyone else knowing about it, afraid that they’ll think it’s silly or grandiose or unnecessary, or that they’’ll end up calling...
2024-08-02
27 reads
One of the little details that I find matter more and more in enterprises is understanding why a tool behaves a certain way. OSS/home-grown ones often have limited docs,...
2024-08-02 (first published: 2024-07-19)
105 reads
I have heard about many interesting things about programming in Rust and I decided to use Rust for one of my applications. I enjoyed the programming experience in Rust...
2024-08-02 (first published: 2024-07-20)
220 reads
In the digital age, data is the new gold, but it's worthless if you can't understand and use it. That's where SQL (Structured Query Language) comes in. SQL is...
2024-08-02
37 reads
By Steve Jones
It’s Prime Day. A few of my recommendations, since I want to do some...
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...
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