PowerShell Module for the SQL Server Diagnostics API – 1st Command Get-SQLDiagRecommendations
I saw this blog post about the SQL Server Diagnostics add-on to SSMS and API and thought I would write...
2017-06-29
731 reads
I saw this blog post about the SQL Server Diagnostics add-on to SSMS and API and thought I would write...
2017-06-29
731 reads
The SQL Server errorlog is a really helpful place to find all sorts of fun facts about your SQL Server...
2017-06-29
895 reads
If you were unable to attend this month’s PASS Security Virtual Chapter webinar, The Dirty Business of Auditing, it has...
2017-06-29
567 reads
In a blog post on the Sparkhound website, I laid out the strong case for a sponsor's Return on Investment...
2017-06-29 (first published: 2017-06-21)
909 reads
Since the DMF sys.dm_io_virtual_file_stats shows cumulative I/O statistics value for the database files, you can’t just use the DMF to...
2017-06-29
1,171 reads
Some time back, while pulling into a local coffee shop, I spotted a stranded motorist in the parking lot. Per...
2017-06-29
544 reads
With SQL Server on Linux, Microsoft has recognized that they’re opening up their products to a new set of users....
2017-06-28 (first published: 2017-06-19)
1,705 reads
In last three years, I presented two times on the topic Transaction Log File Architecture. During the sessions, when I discussed...
2017-06-28 (first published: 2017-06-20)
1,569 reads
The Database Fundamentals series is now done. We started with understanding what a database is, and then spent a little...
2017-06-28
349 reads
SQL in 60 Seconds is a series where I share SQL tips and tricks that you can learn and start using in less than a minute.
Watch this week's video...
2017-06-27
19 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