SQL Server Startup
From time to time I see a question asking how to determine the last time a SQL Server was either...
2011-03-25
1,313 reads
From time to time I see a question asking how to determine the last time a SQL Server was either...
2011-03-25
1,313 reads
To mark my 30th Birthday today, as promised here’s a SQL Server Crossword for you to enjoy. You can find the previous...
2011-03-23
1,554 reads
G’day,
When I design a table in SQL SERVER, I like to have a reasonable understanding of how the table will...
2011-03-22
3,044 reads
It’s reasonably well known that you can get different execution plans if you change the ANSI connection settings. But the...
2011-03-21
1,115 reads
I wrote a post a while back that showed how you can grant execute permission ‘carte blanche’ for a database...
2011-03-18
2,146 reads
The thing that I most enjoy about going to conferences, SQLSaturdays, and user group meetings is the people I get...
2011-03-17
1,072 reads
I was really excited about the concept of Shared DataSets when they were introduced. My excitement diminished a little when...
2011-03-17
1,767 reads
I was recently asked a question on restoring a database using PowerShell with the following requirements
Take a database backup file...
2011-03-16
2,581 reads
We have been doing some more work with SQL Azure lately, so I have put together a small collection of...
2011-03-15
1,831 reads
If you are thinking about attending SQL Server Connections (a part of DevConnections) in Orlando this March 27-30, take advantage...
2011-03-11
638 reads
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...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
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