Technical Article

Red Gate Software Supports SQLSaturday!

If you've read my blog over the past year and a half you know that I've been heavily involved in trying to build a 'franchise' around SQLSaturday, with the guiding principle being that the event has to be locally owned. We've had some decent success, but we've also seen that in many cases groups are reluctant to try hosting one, usually due to one of the following:

Technical Article

SQL Saturday

sql_saturday_logo I’ve been pretty lucky in my career to have the opportunity to attend quite a few conferences. I’ve attended one, and often more than one, a year, and I’ve had great opportunities to not only learn more about SQL Server and technology, but also to network and meet professionals from all over the world, many of whom have become good friends.

Blogs

Fabric for Operational Reporting & SQL Endpoint Trap

By

With Fabric Mirroring, Microsoft is promoting a nice and appealing story for operational reporting...

Crawl, Walk, Run with Agentic Development of Power BI Assets

By

If you’ve been watching AI roll through the data community and thinking, “this seems...

How AgentDBA Diagnoses SQL Server Issues Fast

By

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

Read the latest Blogs

Forums

SQL Art, Part 4: Happy 4th of July — A British DBA's Guide to Celebrating a War We Don't Talk About

By Terry Jago

Comments posted to this topic are about the item SQL Art, Part 4: Happy...

Cosmetics and personal hygiene products are tested by FARE LABS Pvt. Ltd.

By farelabs

Because we are NABL Accredited Laboratories, our personal care and cosmetics research center provides...

Alamat kantor BCA KCU MAKASSAR Telp:0817866887

By Layanan_BCA_24jam

WhatsApp:0817-866-887 Jl. Ahmad Yani No.31, Pattunuang, Kec. Wajo, Kota Makassar, Sulawesi Selatan 90174 (@bcakcumakassar)

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