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

SQL Server 2017 – The operating system returned the error 21

Recently, I was exploring SQL Server 2017 CTP 2.0 using SQL Server Management Studio V17. Till the time, I was restoring the databases using tsql script on the SQL Server 2017 instance, and I didn’t encounter any issue. But, When I tried to restore a database backup using GUI using SSMS V17, I encountered the below error.

The operating system returned the error ’21(The device is not ready.)’ while attempting ‘GetDiskFreeSpace’ on ‘A:\’.
The statement has been terminated. (Microsoft SQL Server, Error: 3634)

Cause

This issue happens because of SMO switched to using sys.dm_os_enumerate_fixed_drives instead of the old xp_fixeddrives to get free space information in this dialog box sequence.

Workaround

You can disable the virtual Floppy drive and CDROM drive from the Device Manager as shown below.

Once you disabled them successfully, let’s try to restore a SQL Server database backup using SSMS V17.

This time it didn’t throw any error ?? ! I am sure the issue will be addressed in the coming release.

Never late to explore and learn something new!

The post SQL Server 2017 – The operating system returned the error 21 appeared first on .

SQL Geek

Dharmendra is a SQL Server/Microsoft Data Platform professional with over eight years of experience. He enjoys helping others in the SQL Server community and does this by contributing on blogs, speaking at several SQL events. His passion and focus is to explore and share more and more on SQL Server.

Comments

Leave a comment on the original post [www.dharmendrakeshari.com, opens in a new window]

Loading comments...