SQL Server 2016 has reduced the NoSQL JSON “advantage” over SQL Server
Microsoft has finally implement support for JSON data in SQL Server 2016 and in Azure SQL Database. In a previous...
2016-12-20
3,637 reads
Microsoft has finally implement support for JSON data in SQL Server 2016 and in Azure SQL Database. In a previous...
2016-12-20
3,637 reads
Don’t trust Invoke-SqlCmd and error resultsI love to call Invoke-sqlcmd from powershell but one must beware of the risk of...
2016-12-19
27,117 reads
Don’t trust Invoke-SqlCmd and error results
I love to call Invoke-sqlcmd from powershell but one must beware of the risk of...
2016-12-13
49 reads
Terminate a SSIS package after specific time interval.
There are several ways you can execute scheduled SSIS package/job they are:
A) SQL...
2013-06-25
8,976 reads
Problem One common task as DBA is to run DBCC CHECKDB on a regular basis to detect and correct potential corruption...
2013-04-18 (first published: 2013-04-10)
11,880 reads
SQL Server Policy Based Management Alerts
Problem
Policy-Based Management is used to enforce standards on SQL Servers and it's great. But not...
2012-12-04
4,338 reads
Running a document database on Sql Server.
Since Microsoft is slow to come out with a product of their own to...
2012-09-26
14,744 reads
Small systems tend to grow with new functionality and new access points. When the system grows, the need for data...
2012-08-16
1,129 reads
First what is JSON?
JSON: JavaScript Object Notation.
JSON is syntax for storing and exchanging text information, similar to XML.
JSON is smaller...
2012-06-25 (first published: 2012-06-14)
18,271 reads
I’ve been rereading an excellent book called “Clean Code” by Robert C. Martin. This book has some practices that each...
2012-06-08
1,210 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