Blogs

Technical Article

Challenging the Tyranny of Third-Party Vendors: A DBA’s Manifesto

  • Article

Over the years, I have dealt with a lot of third-party applications (and their vendors) that use SQL Server as their back-end databases. It has often been an uneasy relationship, fraught with pain and tribulation. The overriding feeling I have gotten...

You rated this post out of 5. Change rating

2009-02-12

1,514 reads

Technical Article

Ways To Build Your Brand

  • Article

This is in the presentation I've given a few times, but I thought it made some sense to put these things out here as well. I see there are a few major ways for you to build your brand and raise your profile in the modern world that is highly interconnected...

You rated this post out of 5. Change rating

2009-02-11

811 reads

Technical Article

Who Do We Choose to Follow?

  • Article

Think about your career and the managers, and potentially leaders, that you’ve had in your life. Think about life in general and who do you admire, who have you modeled yourself after or who you wanted to follow in sports, in a hobby, in life, etc.

You rated this post out of 5. Change rating

2009-02-06

1,353 reads

Technical Article

All the Aggregates you crave with Grouping Sets in SQL Server 2008

  • Article

As reporting requirements increase, it seems that aggregate functionalities have thankfully risen to the occasion concurrently. To maintain its competitive edge as Staples Canada’s best vendor, BaldGorilla, where I’m currently consulting, has been able...

You rated this post out of 5. Change rating

2009-02-05

2,050 reads

Technical Article

Ruthless Focus - A Different Type of Time Management Philosophy

  • Article

If you could list all the reasons I work, the number one reason would be to support my family. My definition of support includes spending an appropriate amount of time with family, not just working to support it. I suspect most of you would agree with that as a goal.

You rated this post out of 5. Change rating

2009-02-04

1,886 reads

Technical Article

PASS Update #3

  • Article

It's been busy since my last update, lots of stuff to work on! I probably won't get it all in one post, but I'll try to hit the highlights. The main event over the past two weeks was my first board meeting in Seattle. I arrived Monday afternoon

You rated this post out of 5. Change rating

2009-02-02

1,001 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...

Finding 'bad' characters

By Barcelona10

Hi All I am trying to find 'bad' characters that users might type in....

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

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