Renaming a Schema in SQL Server
If you have a schema you want to retire, here's a method for moving all objects inside that schema to a new one.
2018-09-25
48,002 reads
If you have a schema you want to retire, here's a method for moving all objects inside that schema to a new one.
2018-09-25
48,002 reads
The announcement of the next version of SQL Server excites Steve.
2018-09-25
327 reads
Adaptive query processing is the latest query processing feature introduced in the SQL Server database engine, available in SQL Server (starting with SQL Server 2017 (14.x)) and Azure SQL Database. Read on to learn more.
2018-09-25
2,801 reads
Azure SSIS Feature pack can be used to upload the data over to Azure Storage account. In this article, Supriya Pande will describe how you can upload the data to Azure Blob Storage using SSIS task.
2018-09-24
6,055 reads
As a data professional or developer, you will likely have questions about how HIPAA impacts you and your day to day responsibilities. Rebecca Edwards answers common questions about HIPAA that you were too shy to ask.
2018-09-24
2,261 reads
2018-09-21 (first published: 2016-01-04)
6,363 reads
In this tip we look at a new feature in SQL Server Reporting Services that allows users to leave comments about reports.
2018-09-21
2,383 reads
2018-09-21
1,949 reads
Determining the number of DTUs which will help in deciding the service tier for Azure SQL.
2018-09-20
1,028 reads
Testing your PowerShell scripts is just as important as testing any code. In this article, Robert Cain demonstrates how to use the testing tool, Pester, to perform unit, integration, and acceptance testing.
2018-09-20
2,439 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