Sql server

Umesh Modi
Umesh Modi used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
John TsioumprisSoftware & Systems Engineer

Commented:
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...

Author

Commented:
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.
John TsioumprisSoftware & Systems Engineer

Commented:
I am thinking that something went terribly bad...probably its time to think about rebuilding the server.
How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Author

Commented:
is any another solution to solve issue??
Dirk StraussSenior Full Stack Developer
Distinguished Expert 2017

Commented:
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.

Author

Commented:
restart the services and also the system but still same issue.
John TsioumprisSoftware & Systems Engineer

Commented:
Maybe hardware issue ?...problem with HDD? memory ?
Dirk StraussSenior Full Stack Developer
Distinguished Expert 2017

Commented:
Did the Event Viewer show anything significant?

Author

Commented:
hi Dirk
Did the Event Viewer show anything significant? means??
Dirk StraussSenior Full Stack Developer
Distinguished Expert 2017

Commented:
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.

Author

Commented:
no error in Event Viewer

Author

Commented:
is any another solution??
Dirk StraussSenior Full Stack Developer
Distinguished Expert 2017

Commented:
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?

Author

Commented:
hi  Dirk
There is no error for sql server

Author

Commented:
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>]
Olaf DoschkeSoftware Developer

Commented:
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.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial