Run For the PASS Board
When the word comes around for elections to the PASS Board, are you one of those people who, even in...
2016-08-22
421 reads
When the word comes around for elections to the PASS Board, are you one of those people who, even in...
2016-08-22
421 reads
I’m acting as the curator to a list of Azure Data Platform Learning Resources. It’s speakers and teachers, blogs, articles...
2016-08-17
516 reads
I love the Query Store. Seriously. It’s a huge leap forward in the capabilities of Azure SQL Database and SQL...
2016-08-23 (first published: 2016-08-15)
1,804 reads
This is post 8 supporting Tim Ford’s (b|t) initiative on #iwanttohelp, #entrylevel. Read about it here.
In post #6, I talked about...
2016-08-15 (first published: 2016-08-09)
1,463 reads
I actually saw the above statement posted online. The person making the claim further stated that choosing between these three constructs was “personal...
2016-08-01
1,389 reads
Blog post #7 in support of Tim Ford’s (b|t) #iwanttohelp, #entrylevel. Read about it here.
Sooner or later when you’re working...
2016-07-28 (first published: 2016-07-25)
2,623 reads
The Common Table Expression (CTE) is a great tool in T-SQL. The CTE provides a mechanism to define a query that...
2016-07-21 (first published: 2016-07-18)
3,602 reads
Based on the number of times I see this question on forums, it must be occurring all the time. You...
2016-07-19 (first published: 2016-07-11)
2,423 reads
Let’s get the caveat out of the way up front, I work for a tool vendor.
If you look around at...
2016-07-05
1,240 reads
Set based operations means you should put everything into a single statement, right?
Well, not really. People seem to think that...
2016-07-06 (first published: 2016-06-28)
4,830 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