Query Tuning Near You
It really is so much easier to just throw hardware at badly performing databases. Just buy a bigger, faster server...
2014-03-19
1,187 reads
It really is so much easier to just throw hardware at badly performing databases. Just buy a bigger, faster server...
2014-03-19
1,187 reads
Ever had that moment where you start getting errors from code that you’ve tested a million times? I had that...
2014-03-18
781 reads
SQL Saturday’s are awesome! Let’s get that clear up front. The organizers of SQL Saturday events are glorious individuals. Let’s...
2014-03-17
671 reads
No, I don’t mean the use of sp_updatestats is not smart. It’s a fine, quick mechanism for getting statistics updated...
2014-03-11
1,121 reads
This never gets easier. I was able to attend a bunch of sessions in the last month from a number...
2014-03-07
873 reads
I spend quite a bit of time writing about query tuning on this blog. I’ve written (re-written and am actively...
2014-02-27
1,283 reads
I am terribly jazzed to be involved with this amazing event, SQL Intersection. It’s featuring some truly amazing speakers presenting...
2014-03-04 (first published: 2014-02-26)
1,634 reads
Deservedly so, I got called out for a bit of attitude I displayed in a recent blog post: Time for...
2014-03-06 (first published: 2014-02-25)
1,846 reads
In case you don’t know, this query:
UPDATE dbo.Test1
SET C2 = 2
WHERE C1 LIKE '%33%';Will run quite a bit slower than this...
2014-02-25 (first published: 2014-02-18)
6,543 reads
Cardinality, basically the number of rows being processed by an operation with the optimizer, is a calculation predicated on the...
2014-02-12
1,172 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