Msg 3140 – Could Not Adjust the Space Allocation for File
I often need to shrink database files. I know, ‘shrinking is bad’, however there are situations where it is very much needed. In my line of work, I come...
2024-10-07
258 reads
I often need to shrink database files. I know, ‘shrinking is bad’, however there are situations where it is very much needed. In my line of work, I come...
2024-10-07
258 reads
Many organizations do not have in-house DBAs. This can be due to a number of reasons. Most commonly it is smaller organizations that cannot justify a full time DBA....
2024-09-16
17 reads
As a data professional, you’ll often get a phone call, email, or trouble ticket that says “SQL Server is slow, my query is slow, or things are slow”. This...
2024-08-12
20 reads
Working with SQL Server over the past 25 years for various organizations all over the world, I usually always find a database server that is well outside of support....
2024-07-15
43 reads
It seems like every few weeks I come across a database server with a very large msdb. After a small amount of investigation work, I determine that the largest...
2024-06-10
26 reads
Often times when working with a client, I’ll run into issues or get emails from a client with a message like the following: A connection was successfully established with...
2024-05-14
28 reads
For a lot of us data professional types, this seems like a silly topic, however I constantly hear of companies that aren’t testing their backups by restoring them, or...
2024-04-23
14 reads
Wednesday March 13th 2024 I had the honor of speaking at the Redgate Summit in Atlanta and got to meet a lot of new people and get to hang...
2024-03-20 (first published: 2024-03-15)
139 reads
I have been involved in countless database migrations. Most of the time I have access to the existing source servers and future destination servers. In cases where you have...
2024-02-26 (first published: 2024-02-15)
494 reads
Azure SQL Database and SQL Server 2016 introduced a new security feature for SQL Server databases called Always Encrypted. Always Encrypted is a feature designed to protect sensitive data,...
2024-02-19 (first published: 2024-02-04)
580 reads
If you’ve been watching AI roll through the data community and thinking, “this seems...
By Arun Sirpal
Not every production incident is a database in RECOVERY_PENDING or a corrupted event (like...
It is Friday, the queries are running, and nobody is watching the bill. That...
Comments posted to this topic are about the item SQL Art, Part 4: Happy...
Hi All I am trying to find 'bad' characters that users might type in....
WhatsApp: 0817839777 Kw. Industri Pulogadung, Jl. Raya Bekasi Km. 21, Ruko No.A2/18-19, RW.3, Wil,...
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