SQLServerCentral Article

Test Your SQL Server Security Skills and Compete with your Friends!

Test to see how much you know about SQL Server security. If you're one of the members to pass the test (72% score or higher), you're entered into a contest to win a copy of AppDetective and one year's worth of support (over $1500 value)! You can only take the test question test once and it is not timed. After the test, you'll be given the answers and why one answer is more correct than another. Questions are randomly chosen from a pool.

SQLServerCentral Article

Is the Schema Still Needed?

Do you know what the schema is? In Relational databases, there is the concept of a database and a table, but the schema sits between them. In SQL Server, this is known as the owner. But do we really need this additional layer? Has it ever caused you problems? Has it outlived its usefulness?

Technical Article

SQL Stripes 0.50 Build 180 Released

SQL Stripes is an application that helps you - the SQL Server DBA, to have complete control over your servers. From the high-level of monitoring essential components to the low-level of analyzing your various databases. SQL Stripes is an intuitive and easy to use application and is intended for SQL Server DBA who want to have an easier life. SQL Stripes is completely free! (Announcement, not reviewed)

SQLServerCentral Article

SQL Server Security: The db_executor Role

Brian will be writing a monthly column for us on SQL Security, definitely a hot topic these days! He starts off by discussing the need for a built in db_executor role and how to grant permissions manually to achieve the same effect. Terrific concept, as granting table access can lead to bad things! If there is a security topic you'd like to see more info on, post a note to the article or email us at articles@sqlservercentral.com.

SQLServerCentral Article

Webcast: 0 to Cluster in 60 Minutes-Clustering Windows and SQL Server

In this session we’ll rapidly discuss the MSCS clustering architecture and deploying the system into your environment. We’ll then jump into a demo where we actually cluster a Windows and SQL Server system in under 60 minutes. We’ll discuss the administration tools and best practices on clustering and walk you through completing a cluster and fixing problems along the way. After this session, you should have just enough information to build you own SQL Server that is highly available.

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