Checking DBCC CHECKDB
I hope you run consistency checks on your databases, if you are not currently doing this you probably will want to....
2017-01-03
580 reads
I hope you run consistency checks on your databases, if you are not currently doing this you probably will want to....
2017-01-03
580 reads
This week’s TSQL Tuesday is being held by the mighty Kenneth Fisher – Backup and Recovery- see this link, how can...
2016-12-26 (first published: 2016-12-07)
1,508 reads
It’s coming towards the holiday season for me and I thought that I would wind-down a little with a non-technical...
2016-12-17
528 reads
I look at locking resources within Azure as a safety mechanism where it can protect users from accidental deletion, it...
2016-12-16
527 reads
Did you know that you can run DBCC CHECKDB (WITH PHYSICAL_ONLY) and issue page restores from SSMS (SQL Server Management...
2016-12-15
478 reads
Following on from my previous post on NOLOCK (https://blobeater.blog/2016/12/09/nolock/) I want to talk about another hint called READPAST. This hint tells...
2016-12-13
460 reads
When you have many SQL databases that are required to run your environments and they show signs of specific usage...
2016-12-12 (first published: 2016-12-02)
1,442 reads
NOLOCK, some say it’s a fast option for queries and will never cause blocking, I say it’s quite dirty and...
2016-12-09
2,331 reads
Wait stats is my go to thing, however I do get bored just querying it via a table so I...
2016-12-06
805 reads
Not a technical post today (not that I am technical) but still an important one. I have been using Azure...
2016-12-01
633 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