Understanding SQL Server Linked Servers
In this tip we look at how to setup a Linked Server in SQL Server using SQL Server Management Studio.
In this tip we look at how to setup a Linked Server in SQL Server using SQL Server Management Studio.
A major outage from Atlassian because of a bad script has Steve thinking about the challenges of recovering from mistakes. When we are making changes to portions of our data and we need to plan for mistakes to occur and ensure we can restore the data.
How to use Flyway and PowerShell to automatically generate a database build script every time Flyway successfully created a new version. You can then investigate schema changes between versions simply by using a Diff tool to compare build scripts.
What’s the difference between Site Reliability Engineering and DevOps? In this article, Grant Fritchey defines each one and compares them.
Learn the basics of Git in this article if you've never used this version control system before. We will cover setting up a repo, adding files, changing them, and getting your history.
SQL Server supports a number of different logical operators. These operators can be used for testing Boolean conditions that return true, false and unknown in your T-SQL code. Logical operators are useful for defining constraints to limit the rows be processed when selecting or updating data. This chapter will provide an overview of the logical […]
When do you choose to use one tool or language over another. Steve discussed T-SQL vs. PowerShell.
With ambitious expansion plans, PointsBet needed an expansive overview of its server estate, whether on Azure or on-premises, anywhere around the world. Find out how SQL Monitor rose to the challenge.
There is sometimes a need to figure out the maximum space that is being used by a particular column in your database. You would initially think that the LEN() function would allow you to do this, but this function does not work on Text, NText or Image data types, so how do you figure out the length of a value in a column that has one of these data types?
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