Blogs

Technical Article

Do You Take Notes?

  • Article

I happen to notice this in a class recently that I had the rare student - one that could take notes that seemed to have value to them the next day. If you watch people take notes, I think they fall into one of these categories: The Highlighter. They have...

You rated this post out of 5. Change rating

2009-04-24

1,989 reads

Technical Article

Taking Advantage

  • Article

I read SQLBatman's post about his first week as an MVP , and it really resonated well with me. I think that he really hit it when he said that he wasn't going to sit around, he was going to go look for information and take things back from the...

You rated this post out of 5. Change rating

2009-04-22

1,226 reads

Technical Article

SSD, The Game Changer

  • Article

I’ve often described SQL Server to people new to databases as a data pump. Just like a water pump, you have limited capacity to move water in or out of a system usually measured in gallons per hour. If you want to upgrade your pumping systems it can be...

(1)

You rated this post out of 5. Change rating

2009-04-21

6,824 reads

Technical Article

PASS Update #9

  • Article

Time has flown by since my last update, busy time at work and struggling to get that done and find a few hours for PASS too. Here's a short version of what I've been working on lately: Added the Top 10 List page and have some starter lists from...

You rated this post out of 5. Change rating

2009-04-20

1,208 reads

Technical Article

Networking = Business Cards

  • Article

I've been writing a lot about networking lately and my efforts to learn/leverage LinkedIn, and along the way taken a few hits for opening up my Linked In network to include those of you who read my blog regularly and want to connect. The essence ...

You rated this post out of 5. Change rating

2009-04-17

1,523 reads

Blogs

Prime Day Recommendations

By

It’s Prime Day. A few of my recommendations, since I want to do some...

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

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 Bumiayu Telp:0818751777

By Halo_BCA

WhatsApp:0818-751-777 Jl. Kalierang No.Ruko 3-5, Dukuhturi, Kec. Bumiayu, Kabupaten Brebes, Jawa Tengah 52273 (@bcakcpbumiayu)

Alamat kantor BCA KCU KELAPA GADING Telp:0818751777

By Layanan_BCA_24jam

WhatsApp:0818-751-777 Menara Satu Sentra Klp. Gading, Jl. Boulevard Bar. Raya No.1 Lt. Dasar, 1,...

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