In Charge
I had to run our weekly conference call this week. My boss is out of the office, but he’s been...
2009-11-25
741 reads
I had to run our weekly conference call this week. My boss is out of the office, but he’s been...
2009-11-25
741 reads
I'm looking over the comments about DBAs and local Administrator rights and I noticed an interesting trend: no one discussed...
2009-11-25
2,602 reads
I know Thanksgiving has some deeper meanings, but at one level it’s all about the food. Food is a good...
2009-11-25
609 reads
It is said that you should not give direct table access (even select permission) to a user or group. But...
2009-11-25
530 reads
I’ve always thought that you should invest where you can. Make a little effort now that will pay back later,...
2009-11-24
741 reads
Earlier this week I posted Part 1 and Part 2, today I want to wrap up by thinking about how...
2009-11-24
567 reads
I've got a four day weekend thanks to the Thanksgiving holiday here in the United States. After reading Jazz in...
2009-11-24
883 reads
Virtually all successful DBAs I know put a lot of focus on education, and the best way to make it...
2009-11-24
540 reads
Here is the latest version of my Diagnostic Information Queries for SQL Server 2008. Running these queries will give you...
2009-11-24
2,441 reads
A new feature of SQL Server 2008 is Table-valued parameters (TVP). This feature will allow Developers and DBAs to pass...
2009-11-24
1,594 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