Using a Staging Environment for Tracking Down Bugs
A discussion why having a staging environment with data that mirrors production is vital to tracking down issues.
Being able to...
2011-06-08
2,138 reads
A discussion why having a staging environment with data that mirrors production is vital to tracking down issues.
Being able to...
2011-06-08
2,138 reads
A discussion about nightly populated tables and how they have reduced SQL Server load.
What’s more important – speed or data accuracy/quality...
2011-06-05
1,296 reads
Why OR conditions in join statements should be avoided and an example fix.
OR conditions and join statements – some things just...
2011-06-03
2,824 reads
A discussion of how BPS uses a SQL exercise for candidates and why it is helpful.
At the Boston Public Schools,...
2011-06-01
2,711 reads
A followup to a post about subqueries with an estimation for how long it would take for the query to...
2011-05-30
3,500 reads
A discussion of how views give a more denormalized means for querying against normalized tables.
Ad-hoc reports are frequently requested at...
2011-05-28
845 reads
A discussion of how NEWID can be used to help randomize the results returned from a SQL query.
A scenario I...
2011-05-26
1,147 reads
A discussion of how joins significantly outperform subqueries and how this is more evident when OR conditions are involved.
SQL queries...
2011-05-25
953 reads
Thank you to everyone reading this site - Please enjoy your stay!
HelpWithSQL has hit double digits in posts! I hope everyone...
2011-05-24
616 reads
A discussion about SQL joins and subqueries with information about how to format join statements properly.
In any non-trivial task, developers...
2011-05-22
1,109 reads
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,...
By Tim Radney
As a SQL Server DBA with years of experience tuning production environments, I’ve seen...
Comments posted to this topic are about the item What is the Cloud?
Comments posted to this topic are about the item Changing the Schema
Comments posted to this topic are about the item Index Fragmentation Explained: Page Splits,...
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