T-SQL Tuesday #151 Coding Standards
This month the T-SQL Tuesday blog party is hosted by my good friend, Mala. This is her fourth time hosting and she has a good topic this time. While...
2022-06-15 (first published: 2022-06-14)
61 reads
This month the T-SQL Tuesday blog party is hosted by my good friend, Mala. This is her fourth time hosting and she has a good topic this time. While...
2022-06-15 (first published: 2022-06-14)
61 reads
Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers. Here are some hints to get started. I...
2022-06-15
111 reads
Foreword
This month’s invitation is from Mala Mahadevan, and it’s about coding standards. Fortunately, I may forget several basic ones because my team probably eradicated them long ago.
I’ll go with...
2022-06-14
14 reads
I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m...
2022-06-14
19 reads
One of my favorite people, Malathi Mahadevan (blog|twitter), is our host this month and she’d like to talk about coding ... Continue reading
2022-06-14
89 reads
It’s that time of the month again, the blog party, woohoo! This time Mala Mahadevan (b | t) has invited us to blog about our T-SQL coding standards. I...
2022-06-14
58 reads
I had a problem at work recently where a record was getting updated, and no one knew where or what was updating the record. Our team discussed the best...
2022-06-14
176 reads
Hello all. I know most of you are still working within SQL Server. However, a few of you are become more like me, hybrid data managers, working in more...
2022-06-13
15 reads
I started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m...
2022-06-13
12 reads
Some datatypes can be shown in so many different forms (think measurament units, dates with short/long forms, or regional settings) that can be difficult to have a standard. What...
2022-06-13 (first published: 2022-06-02)
301 reads
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
It is Friday, the queries are running, and nobody is watching the bill. That...
By Steve Jones
Annabel retired from Redgate Software this week. Across most of my career at Redgate,...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
WhatsApp: 0817839777 Kw. Industri Pulogadung, Jl. Raya Bekasi Km. 21, Ruko No.A2/18-19, RW.3, Wil,...
WhatsApp: 0817839777 Jl. I Gusti Ngurah Rai No.8 A-B, RT.8/RW.6, Wil, Kec. Duren Sawit,...
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 GOI 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 GOThis worked. Now, I move this schema to a new user.
ALTER AUTHORIZATION ON SCHEMA::Myschema TO User3; GOWhat happens with this code?
SETUSER 'USER2' GO SELECT * FROM MySchema.MyTable GOSee possible answers