SQLServerCentral Editorial

Are You a Giver or a Taker?

A guest editorial from Brad McGehee today examines the way in which DBAs interact with the community. Do you take from the community, learning from others? Or do you give back more? Both are a part of many DBAs' careers. Brad talks about the importance of giving back when you can.

SQLServerCentral Editorial

How Oslo can you go?

Some developers have reacted with dismay to the recent news that Microsoft’s Oslo project is being integrated into the SQL Server platform and renamed SQL Server Modeling. The overwhelming feeling seems to be that their DSL dream is being snatched away.

External Article

SQL Server Integration Services (SSIS) - Troubleshooting Best Practices

In the previous tips (SQL Server Integration Services (SSIS) - Best Practices - Part 1 and Part 2) of this series I briefly talked about SSIS and a few of the best practices to consider when designing SSIS packages. Continuing on the same rhythm I am going to discuss some more best practices for SSIS package design, how you can design high performing packages with parallelism, troubleshooting performance problems etc.

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

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...

Alamat Kantor BCA KCP Klender Tlp:0817839777

By layanan_Bca88

WhatsApp: 0817839777 Jl. I Gusti Ngurah Rai No.8 A-B, RT.8/RW.6, Wil, Kec. Duren Sawit,...

Alamat BCA KCP Pondok Bambu Tlp:0817839777

By m4rt1n4

WhatsApp: 0817839777 Pondok Bambu Center, Jl. Pahlawan Revolusi No.30 Blok A/5-6, RT.2/RW.2, Wil, Kec....

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