Blogs

Technical Article

Finding a Work-Life Balance

  • Article

Like most everyone who works hard in our industry, I’ve run into more than a few conflicts trying to balance work and life. Personally, the further I progress in my career, the blurrier the lines become between work time, family/me time, and just plain lazy downtime. It’s quite easy to say that you’re going to spend X hours at work, and the rest of the time is mine, but the reality is ...

You rated this post out of 5. Change rating

2009-03-06

1,308 reads

Technical Article

Detecting When a Login Has Implicit Access to a Database

  • Article

Yesterday I blogged about how to figure out what database principals corresponded to what server principals . The key is to match up the SIDs between sys.server_principals and sys.database_principals. But I also stated there were 3 cases where the logins...

You rated this post out of 5. Change rating

2009-03-05

2,928 reads

Technical Article

PASS Update #6

  • Article

It's been pretty busy since my last post. Just in one week I had at least 12 hours devoted to PASS activities, and I'll share details of some of that here. To start with, I was able to mark another of my Q1 goals complete as Sanj from PASS HQ...

You rated this post out of 5. Change rating

2009-03-04

1,324 reads

Technical Article

You Must Trust Your DBAs

  • Article

This is a follow-on post to You Must Trust Someone. My point in that post was to establish that being able to and and actually trusting your account and server administrators is a necessity. I didn't go into the business aspect of that, but basically it boils down to having a good selection process for candidates, checking out their references, ...

You rated this post out of 5. Change rating

2009-03-03

2,022 reads

Technical Article

Red Gate Software Supports SQLSaturday!

  • Article

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:

You rated this post out of 5. Change rating

2009-03-02

1,244 reads

Technical Article

SQL Saturday

  • Article

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.

You rated this post out of 5. Change rating

2009-03-02

1,852 reads

Technical Article

How do I ... Determine Database Growth If I Am Not Tracking It? -- Error Logs Part III

  • Article

How do I ... Determine Database Growth If I Am Not Tracking It? If your database has grown considerably and you're not sure when or why it happened, you'll be hard pressed to figure out the answer unless you're tracking changes in database size.

You rated this post out of 5. Change rating

2009-02-27

4,388 reads

Technical Article

You Must Trust Someone

  • Article

After some recent talks with security folks and auditors, one of the things I have had a hard time getting across is that you must trust those folks responsible for account and server management when it comes to securing your data. Yes, you can put in...

(1)

You rated this post out of 5. Change rating

2009-02-26

2,549 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