SQL Server – So you like to shrink do you?

If you do – shame on you and shame on me because I do.

Moving on, I found strange behaviour within SQL Server Management Studio (SSMS) version 13.0.15900.1  Look at the following screen shot; do you know what the issue is here?

ShrinkIt

Are you curious? Please read on.

First thing you probably picked up on is the strange naming convention for one of those databases, more specifically Sheep{DB}, I mean come on, who puts curly brackets into a database name? Well I do. It is this that causes the “input String was not in a correct format” error message when you try to shrink the file via SSMS.

As you can see I navigate to the option as below.

ssmsshrink

There is the error.

shrinkError

Strange that the Shrink > Database option works though. Remove those curly brackets and the shrinking of files via SSMS will work.

USE master
GO
ALTER DATABASE [Sheep{DB}]
Modify Name = [SheepDB] ;
GO  

Output: The database name ‘SheepDB’ has been set.

SheepDb

Navigate back to the shrink file operation – it will work now.

shrinkLog

Some discussion points here, why am I using curly brackets? Why am I shrinking? Let’s just say I am sure that my friends won’t be impressed.

 

Leave a Reply