Link to home
Start Free TrialLog in
Avatar of Umesh Modi
Umesh Modi

asked on

Sql server

Facing issue while connecting to sql server
error message:-   Login failed for user 'sa'. Reason: Server is in script upgrade mode. Only administrator can connect at this time. (Microsoft SQL Server, Error: 18401)
how to solve this issue
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Based on the error and according to this blog post : SQL SERVER – Login Failed For User – Reason Server is in Script Upgrade Mode it seems like an update taking longer than it should...i reckon that you restarted the server...
Avatar of Umesh Modi
Umesh Modi

ASKER

i restart the server and also restart the services for sql but still same issue . now its more than 2 days  and still same error show's.
I am thinking that something went terribly bad...probably its time to think about rebuilding the server.
is any another solution to solve issue??
Have a look at this article: [fix]-Error Server is in script upgrade mode. Only administrator can connect at this time and try the suggested steps. The reason is stated as follows:

This occurs when the Service Pack installation completes fully but few scripts such as sqlagentxxx_msdb_upgrade.sq is functional only after the SQL Server service starts the next time. This is done via Script Upgrade that happens when SQL is restarted for the first time after applying the patch. Through this process, SQL Server tries to create the “.mdf” file in the default data location, If the default path unavailable, then the error occurs. The default path can be accessed from the below registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQLServer
I would start by looking in the event viewer to get a more detailed explanation of the error.
restart the services and also the system but still same issue.
Maybe hardware issue ?...problem with HDD? memory ?
Did the Event Viewer show anything significant?
hi Dirk
Did the Event Viewer show anything significant? means??
I'm referring to the Windows Event Viewer. In Control Panel > Administrative Tools > Event Viewer you will be able to view application events and errors.
no error in Event Viewer
is any another solution??
Are you sure that there were no errors in the event viewer pertaining to SQL Server. One thread reported the following:


Check your event viewer. I had the same problem and found that (in my case) it was looking for a directory that didn't exist to perform an upgrade script. NO hint that there was any sort of problem in the dialog, but the event viewer showed clearly what the problem was.

Take another look at your event viewer. Do you see any info, warning or error events for SQL Server?
hi  Dirk
There is no error for sql server
hi Dirk
in Event Viewer
error message Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. Reason: Server is in script upgrade mode. Only administrator can connect at this time. [CLIENT: <local machine>]
You seem to try to analyze the problem from a client. Log in to the server and look into its event log. The server side event log is intersting for sure, and then a local admin on the server should also be the owner of the SQL Server and be able to log in - again at that server. You don't get far from a client.

Connect to the server via remote desktop, perhaps, mstsc.exe

Bye, Olaf.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.