SQL Server – Playing With Trace Flags
Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior. They are usually...
2016-12-01
581 reads
Trace flags are used to temporarily set specific server characteristics or to switch off a particular behavior. They are usually...
2016-12-01
581 reads
We all know what the sqlservr.exe and its importance, but have you noticed the size difference of the .exe when comparing...
2016-11-25
718 reads
For this post I want to show you how I recovered to a LSN where I did do this on...
2016-11-24
639 reads
I remember asking a question at a recent training event, the outcome? I now don’t use task manager to try...
2016-11-21
573 reads
I am in the middle of some research regarding CHECKDB and learnt something new. From SQL Server 2014 onwards the...
2016-11-10
462 reads
When you want to change configuration settings for your SQL Server you would either do it via Management studio (under...
2016-11-08
711 reads
If you have created a SQL Database in Azure (PaaS) and need to make a copy of it on the...
2016-11-07
400 reads
I have a need to encrypt a column within my SQL Database (Azure). I decided to use Always Encrypted. This feature...
2016-11-04
723 reads
I thought that it would be handy to capture some Perfmon graphs of what happens to backup throughput and CPU...
2016-11-03
476 reads
In my last post I showed you how to conduct an assessment using DMA – Database Migration Assessment tool v2.0 This...
2016-11-02
587 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