SQL Server – Find all the LOB Data Type Columns in a Database Using T-SQL Script
Today morning when I was working on a huge database containing lots of LOB data, I was required to know...
2013-09-12
879 reads
Today morning when I was working on a huge database containing lots of LOB data, I was required to know...
2013-09-12
879 reads
Even though there are more pros than cons, Striping database backups are often overlooked by many DBAs. Based on my...
2013-09-03
1,668 reads
Ever noticed and wondered why the well-known SQL Server system administrator (sa) login is in a disabled state? The reason...
2013-08-20
742 reads
Most of the DBAs at some point of time in their career should have faced at-least one of the below...
2013-08-10
1,395 reads
Cleaning/deleting the old backup files is equally important as taking the backups. Doing so we can (i) Avoid overhead cost for...
2013-08-07
1,002 reads
Earlier today I was required to pull the list of all SQL Login Accounts, Windows Login Accounts and Windows Group Login...
2013-08-06
1,416 reads
One of the first things I did when I began my journey with SQL Server was installing a sample database....
2013-07-31
1,603 reads
From a recent conversation with a customer, I noticed even some of the experienced DBAs are not very clear about...
2013-06-28
1,622 reads
By default, SQL Server automatically assigns a value to the Identity Column for each new row inserted into the table....
2013-06-02
673 reads
In SQL Serve 2012, we can get the default data file and log file locations using a simple T-SQL query...
2013-05-23
663 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