Why Test SQL Server Backups
For a lot of us data professional types, this seems like a silly topic, however I constantly hear of companies that aren’t testing their backups by restoring them, or...
2024-04-23
14 reads
For a lot of us data professional types, this seems like a silly topic, however I constantly hear of companies that aren’t testing their backups by restoring them, or...
2024-04-23
14 reads
In today’s fast-paced digital world, keeping your data safe and accessible is more important than ever. That’s where Azure SQL Database steps in, offering a suite of tools to...
2024-04-22 (first published: 2024-04-05)
402 reads
I leave tonight for Australia. I was in London 3 days ago, so this will complete my halfway around the world trip when I time travel tomorrow and skip...
2024-04-22
23 reads
I was working with a customer and discussing how to do error handling. This is a short post that looks at how you can start adding TRY.. CATCH blocks...
2024-04-22 (first published: 2024-03-27)
639 reads
apolytus– n. the moment you realize you are changing as a person, finally outgrowing your old problems like a reptile shedding its skin, already able to twist back around...
2024-04-19
84 reads
I was approached by Manning Publications and asked to review 100 SQL Server Mistakes and How to Avoid Them. They gave me a free copy of the book (and...
2024-04-19 (first published: 2024-03-25)
531 reads
Over the past couple of months, I have started losing my ability to talk without a mask. One of the effects of a disease, ALS, is that I am...
2024-04-19
31 reads
Data is everywhere, and if you want to make sense of it, SQL (Structured Query Language) is your secret weapon. Whether it’s managing customer data or analyzing trends, SQL...
2024-04-19 (first published: 2024-04-06)
466 reads
I’ve watched teams spend a lot of time on backup strategy. They plan out the full, differential, and log backups to ensure they can successfully meet the recovery point...
2024-04-17 (first published: 2024-04-05)
339 reads
In today’s world, data is everywhere. Companies collect it, governments analyze it, and it influences everything from what products we buy to how we vote. But all that data...
2024-04-17 (first published: 2024-04-05)
203 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