SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

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.

 


Filed under: Admin, SQL SERVER Tagged: Admin, GUI, Shrink, SQL server, SSMS

All About SQL

I am a Senior DBA with interest in MS technology especially SQL Server and Azure. During 2015 I was mentored by Paul Randal – Data Platform (SQL Server) MVP and during 2016 I completed my SQLskills Immersion training on Internals and Performance Tuning. When I am not working I am in the gym burning calories.

Comments

Leave a comment on the original post [blobeater.blog, opens in a new window]

Loading comments...