Azure SQL Database Connect and Query
There is a lightweight and quick way to start querying your database in Azure which doesn’t involve SQL Operations Studio or Management Studio. You can use the query editor...
2019-07-25
20 reads
There is a lightweight and quick way to start querying your database in Azure which doesn’t involve SQL Operations Studio or Management Studio. You can use the query editor...
2019-07-25
20 reads
Quite a simple requirement (when I needed it a few months ago). Study my Azure SQL database environment below. As you can see I have a standard elastic pool...
2019-07-22
31 reads
I am sure many missed the updates to Azure SQL Database SLA (Service Level Agreement). It used to be 99.99% across all tiers but split between two different high-availability...
2019-07-19
212 reads
Learn how to configure connectivity and firewall rules for your Azure SQL Database
2019-07-17 (first published: 2018-09-26)
3,055 reads
While not specific to SQL Server 2019 (I was using this version to do some testing) I was struggling to find how to change the time period of analysis...
2019-07-17
34 reads
The purpose of an Elastic Job is to execute a T-SQL script that is scheduled or executed ad-hoc against a group of Azure SQL databases. Targets can be in...
2019-07-11
179 reads
It is always a dark art trying to suss out why he/she is an MVP? Do they deserve it? What does it take? Why can’t I get it? The...
2019-07-05
22 reads
Using Graph DB is a good way to show relationships between entities (more specifically a vertex and edges). This is why you would use this approach over classic SQL...
2019-06-24
25 reads
I had a good question from JP via a comment on my blog about whether you can use the MAXDOP query hint in Azure SQL Database. The answer? Yes....
2019-06-24
26 reads
Let’s use the Azure portal to build a globally distributed Cosmos DB. Before doing this, why would you ? what are the benefits? Regional based. By this I mean...
2019-06-18
61 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