PRB: SQL Server 7.0 Service Pack Installation Fails with an Error Message When a Script File Is Run (264123)



The information in this article applies to:

  • Microsoft SQL Server 7.0 Service Pack 4
  • Microsoft SQL Server 7.0 Service Pack 2
  • Microsoft SQL Server 7.0 Service Pack 3

This article was previously published under Q264123
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SYMPTOMS

When you try to install SQL Server 7.0 Service Pack 2 (SP2), Service Pack 3 (SP3), or Service Pack 4 (SP4) the installation fails while it is trying to run SQL Server script files. The following error message demonstrates an example of this failure with the Upgrade.sql file. This problem might also occur with other SQL Server scripts during the upgrade process.
Error running script: upgrade.sql(1)
Followed by:
An error occurred when running the upgrade on your server.
The following errors are logged in the Sqlsp.log file located in the temp directory of the computer on which it was run:
11:59:32 Mode: Normal
11:59:34 Resuming Setup - starting at position 2
11:59:40 Begin CleanUpInstall
11:59:42 C:\TEMP\_ISTMP7.DIR\scm.exe -Silent 1 -Action 6 -Service MSSQLServer
12:00:22 Prcess Exit Code: (0)
12:00:32 C:\TEMP\_ISTMP7.DIR\scm.exe -Silent 1 -Action 1 -Service MSSQLServer -StartupOptions \-f \-m
12:00:53 Process Exit Code: (0)
12:01:03 C:\TEMP\_ISTMP7.DIR\osql.exe -n -d master -q"exit" -U sa -P
12:01:03 Process Exit Code: (1)
12:01:03 C:\TEMP\_ISTMP7.DIR\osql.exe -n -d master -i "D:\MSSQL7\install\upgrade.sql" -U sa -P
12:01:03 Process Exit Code: (1)
12:01:13 Error running script: upgrade.sql (1)
12:01:13 C:\TEMP\_ISTMP7.DIR\scm.exe -Silent 1 -Action 6 -Service MSSQLServer
12:01:33 Process Exit Code: (0)
12:01:33 C:\TEMP\_ISTMP7.DIR\scm.exe -Silent 1 -Action 6 -Service MSSQLServer
12:01:43 Process Exit Code: (0)
12:01:45 An error occurred when running the upgrade on your server.
12:01:45 Installation Failed.
				
The Upgrade.out file found in the \Mssql7\Install directory also contains the following error message:
Login failed for user 'username'

CAUSE

Just before the setup attempts to run the SQL Server script files, it puts SQL Server in single user mode. If there are any applications or processes that automatically connect to SQL Server after it starts, they use up the single available connection before the setup process can connect to SQL Server. This prevents the SQL Server script file from running and causes the error message to occur.

WORKAROUND

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
To work around this problem, follow these steps:
  1. Delete the following registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\Setup\"Resume"
    						

  2. Rename the Sqlsp.log file located in the temp directory of the computer on which the service pack setup was run.
  3. In Control Panel, double-click Services. Stop all services and set them to manual, except the following: On Windows NT 4.0:

    • Alerter
    • ClipBook Server
    • Computer Browser
    • Directory Replicator
    • Event Log
    • License Logging
    • Messenger
    • Net Logon
    • Network DDE
    • Network DDE DSDM
    • NT LM Security Support Provider
    • Remote Procedure Call (RPC) Locator
    • Remote Procedure Call (RPC) Service
    • Schedule
    • Server
    • Spooler
    • UPS
    • Workstation

    On Windows 2000:

    • Alerter
    • Computer Browser
    • Distributed File System
    • Distributed Link Tracking Client
    • Distributed Link Tracking Server
    • DNS Client
    • Event Log
    • IPSEC Policy Agent
    • License Logging Service
    • Logical Disk Manager
    • Messenger
    • Net Logon
    • NT LM Security Support Provider
    • Network Connectors
    • Plug and Play
    • Process Control
    • Remote Procedure Call (RPC) Locator
    • Remote Procedure Call (RPC) Service
    • Remote Registry Service
    • Removable Storage
    • RunAs Service
    • Security Accounts Manager
    • Server
    • Spooler
    • TCP/IP NetBIOS Helper
    • Time Service
    • Windows Management Instrumentation Driver Extensions
    • Windows Time
    • Workstation

  4. Close all applications that might be open, including Microsoft Internet Information Server (IIS), BackupExec, NEtIQ, Microsoft Systems Management Server (SMS), and any anti-virus software.
  5. Restart the computer, and then log on with an account that has Local Administrator privileges for that computer. Run the service pack installation. If the setup still fails, repeat the preceding steps and continue with step 6.
  6. Disconnect the computer from the network.

    If you are unable to disconnect the computer from the network, try to identify which application or user is logging on to SQL Server when it starts by using these steps:
    1. To enable auditing in the SQL Enterprise Manager, from the Tools menu, click SQL Server Configuration Properties, and then click Security.
    2. Under Audit Level, select All to audit both successful and failed login attempts.
    This inserts an entry in the SQL Server error log and Microsoft Windows NT Application Log for each login attempt with the userid of the user.

    NOTE: You should turn Auditing off when it is no longer required because it can cause the SQL Server error log and Windows NT Application Log to fill up.

  7. Run the SQL Server Service Pack setup again.

MORE INFORMATION

Another situation in which this error occurs is when the BUILTIN\Administrators login is missing in SQL Server or is not part of the sysadmin role. This happens because, during installation, the setup program launches Upgrade.sql using an ISQL-trusted connection, and the BUILTIN\Administrators group is used to grant to the members of the Windows NT 4.0 or Windows 2000 local administrators group.

Modification Type:MajorLast Reviewed:6/29/2004
Keywords:kbprb KB264123