I am having the following sql server error, while creating tempDB files. Any ideas?

enter image description here

The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts. (Microsoft SQL Server, Error: 0)

4 Answers 4


This is an old thread but this was the first hit on Google so I'm going to add my experience here. I was using SQL Server 2014 Enterprise while remote connected to the server.

I was attempting to restore a database from backup WITH REPLACE and RESTORE WITH NORECOVERY. Between the backup and my first transaction log I received the error indicated above. No databases on the server were able to be accessed; all received the same message. I was, however, able to access the other databases by connecting through a local instance of SSMS and it indicated that my intended target database was (Restoring...), as expected.

Turns out, all I had to do on the server instance of SSMS was restart SSMS. All was normal after that.

  • That helped. In my case I only disconnected the DB Server in the Object Explorer and reconnected. Didn't need to restart SSMS itself. Thanks for adding your solution
    – Francis
    Commented Feb 24, 2021 at 15:23
  • restarting SSMS works, thanks. Commented Apr 9, 2022 at 21:36

I had this issue when I was trying to Deploying a Database to Azure SQL Server. I tried a few times and I got the same error. I double-check the Azure permissions, Firewall, user and pwd.

What I did to fix it was run SQL Management Studio as Administrator. Simple as it.

I believe the problem was some permission to the temporary file to "C:\Users\xxx\AppData\Local\Temp" to create bacpac file.


This has been sorted out.

what it was is that while changing the tempDB file locations I put them in the T: drive and the sql server accounts did not have permissions there.

After I have copied all permissions from the sql server data folder to the T: drive it all worked fine.

to copy all the folder permissions from D:\data to T:\tempdb using Powershell (run as administrator):

$Acl = Get-Acl "D:\data"
Set-Acl "T:\tempdb" $Acl

enter image description here


My problem was rather stupid I opened a query to my already connected server but as the query was not connected, running a line on it gave me this error so first of all check if you are connected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.