SQL Server – Script to generate Read-Only Routing URLs
If you are familiar with the new feature Read-Only Routing introduced in SQL Server 2012 with AlwaysOn then you should...
2015-10-01
512 reads
If you are familiar with the new feature Read-Only Routing introduced in SQL Server 2012 with AlwaysOn then you should...
2015-10-01
512 reads
With the release of Microsoft SQL Server 2014, we have the first version of SQL Server that supports encrypting database...
2015-07-21
685 reads
DBAs most often face scenarios where they need to capture graphical execution plan of a query currently running on a live production instance because...
2015-06-05
1,105 reads
Recently I came across a situation where queries are loading extremely slow from a table. After careful analysis we found...
2015-06-04
703 reads
Most people prefer to have “sa” account as the database owner, primary reason being sa login cannot be removed/deleted unlike any...
2015-05-05
388 reads
According to MSDN: If the SQL Server service is running as a built-in account, such as Local System, Local Service,...
2015-02-06
634 reads
Most of us know the default port for SQL Server is 1433, but there are various ports being used by SQL Server...
2014-12-07
374 reads
I have been noticing one very common error that occurs while trying to failover an Availability Group in SQL Server 2012 AlwaysON...
2014-10-28
1,999 reads
Last week on one of our production servers (version 2011.110.3373.0), we’ve encountered a strange issue which is relatively new (only...
2014-08-12
598 reads
An auto-growth event is the process by which the SQL Server engine expands the size of a database file when...
2014-06-25
1,101 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