Leveraging Constraint Evaluation Sequence in SQL Server
Constraints on a table in SQL Server are evaluated in a specific sequence. Knowing this sequence can help us leverage them to realize various business requirements.
2014-01-27
2,948 reads
Constraints on a table in SQL Server are evaluated in a specific sequence. Knowing this sequence can help us leverage them to realize various business requirements.
2014-01-27
2,948 reads
A SQL Server migration with minimal business impact while synchronizing schema and data.
2013-09-23
3,379 reads
Learn how you can manipulat XML documents solely in memory. No file required.
2013-05-15
13,591 reads
This script quickly returns Server Name, Cluster Node, Default Drive Letter for MSDB database, IP address and port
2013-04-11 (first published: 2013-03-24)
1,470 reads
Auditing, conflict resolution, tamper & concurrency protection are some of the most common requirements for any enterprise system – this 2-part series presents an in-depth look at the various change detection mechanisms available within SQL Server.
2013-02-19
8,388 reads
This article will show you how to use user-defined triggers to supplement your security policies, preventing unauthorised data manipulation and blocking unfriendly logins.
2012-07-12
6,530 reads
Not everything in SQL Server is documented and Steve Jones doesn't think that everything should be. However some features are used often and should have additional documentation.
2012-06-26
349 reads
A small retake on the popular percent complete script which tell how much more time an executing command will take.
2012-03-21 (first published: 2012-03-07)
1,624 reads
In my previous article we discussed Change Tracking which is one of the new technologies introduced by Microsoft. This article will focus on Change Data Capture.
2014-12-12 (first published: 2012-01-16)
13,541 reads
SSRS 2008 R2 introduced lots of exciting new features, reviewed in a sister article to this one. Here we consider what Microsoft didn't do well in this version of Reporting Services.
2011-09-06
15,815 reads
By Steve Jones
It’s Prime Day. A few of my recommendations, since I want to do some...
With Fabric Mirroring, Microsoft is promoting a nice and appealing story for operational reporting...
If you’ve been watching AI roll through the data community and thinking, “this seems...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
WhatsApp:0818-751-777 Jl. Kalierang No.Ruko 3-5, Dukuhturi, Kec. Bumiayu, Kabupaten Brebes, Jawa Tengah 52273 (@bcakcpbumiayu)
WhatsApp:0818-751-777 Menara Satu Sentra Klp. Gading, Jl. Boulevard Bar. Raya No.1 Lt. Dasar, 1,...
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