Press Release


External Article

SQL Server Survey

How do you use SQL Server, and how do you expect this to change next year? Fill in our survey, and enter a prize draw to win Amazon vouchers.

2014-12-11 (first published: )

19,631 reads

SQLServerCentral Article

The 2014 Tribal Awards - Nominations Open

Nominations open until December 10. The Tribal Awards are back and looking to recognize some of the great contributors to the SQL community. Nominations are now open for 11 different categories, but closing soon so make sure your user group, favorite twitter account, or person who's helped you the most this year is nominated.

You rated this post out of 5. Change rating

2014-12-09 (first published: )

714 reads

External Article

SQL Monitor Custom Metric: Possible Duplicate Indexes

When a table has multiple indexes defined on the same columns, it produces duplicate indexes that waste space and have a negative impact on performance. This metric measures the number of possible duplicate indexes per database above a set threshold. You can then consider dropping the indexes and reverse the change.

2014-11-18

7,931 reads

Technical Article

SQL Server Luxembourg: Wait Watchers

On November 19, 2014, the SQL Server Luxembourg User Group and Dell Software will be hosting a free event. Richard Douglas will be be presenting a double bill: SQL Server 2014 features everyone can use, and Wait watchers - Gain Performance Increases Fast! This event is free to registered attendees.

(1)

You rated this post out of 5. Change rating

2014-11-11

6,908 reads

Blogs

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

Rethinking Index Maintenance: Why avg_fragmentation_in_percent Is Outdated and What You Should Do Instead

By

As a SQL Server DBA with years of experience tuning production environments, I’ve seen...

Read the latest Blogs

Forums

What is the Cloud?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is the Cloud?

Changing the Schema

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Changing the Schema

Index Fragmentation Explained: Page Splits, Logical Reads, and What to Do

By Sanket Parmar

Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits,...

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