Press Release


Technical Article

SQL Saturday #255 Dallas

SQL Saturday is coming to Dallas on November 2. This is a free, one day conference for SQL Server training and networking.

On November 1, there will be a pre-conference event featuring Andy Leonard, Grant Fritchey, and Drew Minkin.

2013-10-24

3,031 reads

External Article

SQL Monitor Performance Metric: Buffer Cache Used Per Database in MB

Data pages read from disk are placed in the buffer pool with the intention that they will be reused, and accessing them from RAM is faster than from disk. Knowing how much of your RAM is committed to each database can help you provision the right amount of RAM to SQL Server, and also to identify rogue queries that draw too much data into RAM and force data from other databases out of the cache.

2013-10-15

3,478 reads

External Article

SQL in the City Charlotte 2013

Join Red Gate on the day before PASS Summit for a full-day of free training from SQL Server MVPs and top presenters. Get $200 off your PASS conference ticket when you register for SQL in the City Charlotte, which takes place on Monday October 14.

2013-10-02 (first published: )

4,122 reads

External Article

SQL in the City Atlanta 2013

SQL in the City is coming to Atlanta on October 11. The second stop on the SQL in the City US Tour brings you SQL Server MVP experts including, Steve Jones and Grant Fritchey. Learn top tips and best practices for SQL Server database development and administration, discover the latest Red Gate tools, and network with fellow data professionals.

2013-10-01 (first published: )

3,799 reads

Blogs

How AgentDBA Diagnoses SQL Server Issues Fast

By

Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...

Five Ways Redshift Serverless Quietly Eats Your Budget

By

It is Friday, the queries are running, and nobody is watching the bill. That...

A Career of Memories

By

Annabel retired from Redgate Software this week. Across most of my career at Redgate,...

Read the latest Blogs

Forums

Extreme DAX: Take your Power BI and Fabric analytics skills to the next level

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Extreme DAX: Take your Power...

What is the Cloud?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is the Cloud?

Changing the Schema

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Changing the Schema

Visit the forum

Question of the Day

Changing the Schema

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
GO
I 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
GO
This worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3;
GO
What happens with this code?
SETUSER 'USER2'
GO
SELECT * FROM MySchema.MyTable
GO

See possible answers