I just can’t get enough of the error messages that land into my Inbox almost every single day. I do my due diligence of making a search in my blogs and I try to hang around in the forums from time to time to learn what people are getting as errors. While browsing through forums, I have been able to find that this error was faced by many users. It is one of the most common errors that seem to land, let me know if you ever faced the following error in your environments:
Login failed for user ‘MyDomain\Username. Reason: Server is in script upgrade mode. Only administrator can connect at this time. (.Net SqlClient Data Provider)
I did some more research and found below facts:
- Whenever any SQL Server patch is applied, setup would patch the binaries first.
- During the restart of instance, SQL Server startup would go though “script upgrade mode” during recovery phase.
- Script upgrade mode is the phase where objects inside the databases are upgraded based on recently patch applied.
- Based on features installed and number of databases available, it would take varying amount of time.
The best way to look at the upgrade script status is to keep observing ERRORLOG continuously. Since we would be not able to connect to SQL via SSMS or client tools, we need to open ERRORLOG via windows explorer by going to physical location. Once “Recovery is complete” message is printed in ERRORLOG, we should not see the message any further.
Reference: Pinal Dave (http://blog.sqlauthority.com)