2024-07-16
21 reads
2024-07-16
21 reads
I love QuickieStore, but I wanted some columns to be at the front end of the results returned. Namely, I wanted top_waits, query_sql_text, and query_plan right after database name....
2024-07-15 (first published: 2024-07-03)
307 reads
I recently received a complaint that Query Store for a particular database was turned off, which was strange as that particular database has seen quite a few performance issues...
2024-07-15 (first published: 2024-07-04)
704 reads
Working with SQL Server over the past 25 years for various organizations all over the world, I usually always find a database server that is well outside of support....
2024-07-15
43 reads
fitching – v. intr. compulsively turning away from works of art you find frustratingly, nauseatingly good – wanting to shut off the film and leave the theater, or devour...
2024-07-12
33 reads
Hey all! Quick one here. Tracy Boggiano, awesome person that she is, has put together an interesting collection of data over on GitHub. It’s titled DBA Resources, but it...
2024-07-12 (first published: 2024-06-27)
217 reads
What topics do you want to see presented at a future SQL Saturday (or other event)? Steve Rezhener has built a survey that you can take. Take the survey...
2024-07-12 (first published: 2024-06-25)
91 reads
Taking advantage of our free site offer for your WordPress community? Here are some new templates you can use.
2024-07-11
26 reads
Where I work, we will be migrating data from one set of databases into another. I will be making a copy of the destination databases to allow us to...
2024-07-10 (first published: 2024-06-25)
379 reads
There are quite a few different ways that you’re likely to see windows functions evidence themselves within your execution plan. Let’s take a look at one example. Windows Function...
2024-07-10 (first published: 2024-06-24)
277 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