Unit Testing, Databases, and You
As database changes are added to the DevOps pipeline, unit testing of those changes becomes crucial. In this article, Adam Hafner describes unit testing and how it applies to databases.
2019-06-06
As database changes are added to the DevOps pipeline, unit testing of those changes becomes crucial. In this article, Adam Hafner describes unit testing and how it applies to databases.
2019-06-06
In this tip we look at a script to find SSIS packages that are stuck executing and how to end the package execution.
2019-06-05
In this tip we look at some of the advantages and disadvantages of using triggers in SQL Server.
2019-06-05
Learn how to remove gaps in Identity values in SQL Server caused by Identity Cache.
2019-06-04
In this tip we look at how to use Common Table Expressions CTE in SQL Server including the syntax, use cases, using more than 1 CTE at the same time and recursive CTEs with a parameter.
2019-06-04
There are many instances when dates and times don't show up at your doorstep in the format you'd like it to be, nor does the output of a query fit the needs of the people viewing it.
2019-06-03
SQL Server has many tools used to make it secure. In this article, Robert Sheldon demonstrates several of these features including SQL Server Configuration Manager and the Vulnerability Assessment tool.
2019-06-03
Wanna make your SQL Server applications go faster? Here are 9 simple tips that will give you a better chance for success. They’re not carved in stone, but they’re a good place to start.
2019-05-31
There is a constant pressure in software delivery to release at speed and often. However, there is no sense in delivering fast if what you deliver contains errors or is of no value to the customer. Our latest blog explains how database unit testing can set your team up for valued software delivery.
2019-05-31
In this tip we look at how to use substring functions or similar using T-SQL, R and Python when working with SQL Server.
2019-05-31
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