A. A. Try the following check-list of things that could go wrong. Notes apply to all versions/types of SQL Server unless otherwise specified.

1. On an NT box make sure you have administrator level permissions on the machine in question, as SQL needs to create registry entries, services etc. 

2. Make sure that the Server and Workstation services are running. If the server service is not running you may see an error "Error 2114 occurred while attempting to perform operation 'NetServergetInfo'". Look in the NT event log to ascertain the chain of events that has caused the services not to start.

3. Make sure the machine is of the required spec to run the version of SQL you are installing. I.e. if it is SQL EE then make sure you have NT EE. For SQL 7 you need a 100% PENTIUM compatible chip or an Alpha - older Cyrix/IBM chips that do not support the full pentium instruction set will not work. More info in another faq entry.

4. If you have tried to install SQL before then manually clean-up all the files/registry entries as follows :-

Remove the <sql> directory and everything under it
Remove the <sql> dir from the path (use control panel/system for this)
Remove the SQL registry entries using regedt32/regedit. These are :-
(All versions)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
(6.0 and above.)
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\MSDTC
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLExecutive
(7.0 and above)
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLServerAgent
HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server 7
HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServ65

If you have lost permission to any of the registry keys then log on as administrator and take ownership of them starting at the highest relevant level. Use regedt32 and check the box to take ownership of all subkeys as well.

5. If SQL is complaining about not enough space being there, then this could be due to a known bug when there is between <n> times 4,295,917 KB and <n> times 4,367,417 KB. To get around this either create temporary files to use space up, or start the SQL setup program as follows. Spacing is important.

<sqldir>\i386\setup /t SpaceChecking = Off

6. SQL Server is dependent on network functionality - even for the set-up routines. Specifically it needs to use named-pipe/mailslot functionality (on NT machines - see number 6 for Win9x). These usually require a network card to be present. If you don't have a network card then go to control panel/networks, choose add adapter and then add the Microsoft loopback adapter - which is just a dummy driver, no hardware involved. This needs to have working network protocol(s) bound to it. Let whichever protocols you have use default parameters, EXCEPT for tcp-ip. If you are using this then do NOT specify dhcp assigned address, use 192.168.1.1 as the IP address and 255.255.255.0 as the subnet mask. This is a standard RFC1918 non-routed IP address so shouldn't clash with any dial-up address you may be given by an ISP. If you are using the IPX/SPX protocol, accept the default frame type of 802.3.

If the server service does not start after installing the loopback adapter and you get the message "The server service terminated with the following error: Not enough server storage is available to process this command" in the event log, then you need to re-install your *NT* service pack to synchronise your NT networking files. 

One way of testing that the named-pipes functionality works is to run the makepipe and readpipe utilities that come with SQL Server. Run makepipe in one command window. Then run readpipe in another. If these work (i.e. the readpipe connects to makepipe and closes it down) then it is a good indication that networking functionality is ok.

7. If you're installing SQL 7 on Windows 9x then you have to install Microsoft Client for Networks via the Network applet in Control Panel (note, this isn't the "Microsoft Family" network that will get installed by default). It must also be your primary network logon. Make sure this has a working protocol on it as per number 5. Once SQL 7 is installed then it doesn't need to be your Primary Network Logon, but it still needs to be installed.

8. Because a named-pipe, used by the set-up routine, is effectively a file as far as the operating system is concerned, real-time Virus scanners can cause problems. Most of these have been fixed so they don't interfere with SQL's named-pipes, so make sure you're running the latest version of whichever virus package you use. But if in doubt, then disable the virus software for the duration of the install as they are prime culprits for install errors/hangs.

9. Other software packages/services can also interfere with SQL's install on NT systems - typically they interfere with named-pipes/mailslot connectivity by intercepting requests. Setup will terminate with an error like 'unable to write to mailslot.....'. Shut-down any/all of these for the duration of the install. Packages that are known to interfere with SQL's setup routines include :-

IIS - Internet Information Server - the web parts, not FTP
PWS - Personal Web Server
Exchange Server
SNA Server
Oracle
DBWeb
Backup software e.g. Arcserve/Backup Exec
Systems Management - e.g. UniCentre, Compaq Insight Manager
Microsoft SMTP
Microsoft NNTP
Disk Keeper
Protected Storage (part of Internet Explorer)
SNMP Service(s) 

On Win9x systems you may also get problems if the following are running :-

Quicken Download Manager 

10. If the dial-up networking icon/window appears and tries to make a network connection, then stop and disable the "Remote Access Autodial Manager" service via control panel/services. This is an NT issue rather than a SQL one, but disabling auto-dial is the easiest way around it. (The autodial.txt faq entry has more info).

11. If you are upgrading make sure that the default database for the "sa" login is master.

12. If the error is to do with SQL Performance Monitor counters - SQLCTRxx.DLL - then try removing the SNMP service and all 3rd party network/server monitoring tools. e.g. HP NetServer Agents, Compaq Insight Manager

13. If you are getting a gpf or registry error installing on NT then this could be a known issue with SNMP caused when SNMP managers that come with some server management tools (especially with HP servers) register a lot of SNMP extensions. Specifically when HKLM\System\CCS\Services\SNMP\Paramaters\ExtensionAgents got to around 1K or more.

Either remove the SNMP service before installing SQL Server, or try the following workaround.

- Stop snmp service
- Save the contents (all the values) of the mentioned subkey (use regedt32
for these operations)
- Delete all values except the one with the 'largest' name (the names are
composed of digits)
- Install SQL Server
- Check the 'extensionagents' subkey. Setup will have added a value entry
for SQL Server, save the value name and value somewhere so you can manually
add it again later.
- Restore all 'extensionagents' values previously saved in step 2
- Add the sqlserver entry in case it got nuked in the previous step
- Re-start snmp

14. If the problem is to do with ODBC files not installing due to them being "in use" - typically a SQL 7 problem - then check that nothing has the ODBC files open. This could be other SQL utilities, Exchange, IIS, SNMP Service, Compaq Insight Manager, Backup Exec, Microsoft Netshow Program server, Terminal Server License Server and many other services. Download NTHANDLE/X from www.sysinternals.com (free) if you can't figure out what has the file(s) open - check view dll's, then go into the search function and look for odbc*.dll. It could also be that the ODBC files on your hard-drive have been marked as read-only. Check with ATTRIB.EXE or explorer to see if this is the case.

15. If the error is "Critical Error, could not open the file named D:\MSSQL\BINN\SQLCTRxx.DLL" then first try just retrying as the way performance monitor works it could just have a temporary lock on the file. If that doesn't work then use NTHANDLE/X as per number 13.

16. If it hangs on "Setup is now installing the initial SQL Server configuration" screen, then it could be a timing problem caused by a VERY fast hard disk subsystem. Check the instmsb.out file in the <sql>\install directory and look for the following messages.

98/01/28 12:28:31.43 spid11 Database 'msdb' cannot be opened - it is currently being created. Wait and try query again.

98/01/28 12:28:31.43 spid11 Unable to proceed with the recovery of dbid <5> because of previous errors. Continuing with the next database.

If this is the error then copy the SQL Server installation files to the local hard disk drive. Edit the Instmsdb.sql file. Add a WAITFOR DELAY '0:00:01' statement to the very beginning of the script.

17. If the .OUT files indicate that ISQL cannot connect to the SQL Server to run scripts then you can try the following (note this isn't supported, and the author has only used it to fix servicepack installs so far, but it *may* work for full installs as well). After making the change run "setup /t Local = Yes"

Make a backup of the setup.inf first, then find the following line

set !ServerName = $(!ComputerName)

Now add the following 3 lines after it

ifstr(i) $(!Local) == "Yes"
set !ServerName = "."
endif

18. If it still can't connect to the server during install then this could be a timing problem due to you choosing a non-default codepage/sort-order. Try installing using the default settings. If this works then re-run the setup program after install and re-build master to the settings you want.

19. For SQL 7 check the cnfgsvr.out file in <sql>\install. If you get "An error occurred while attempting to start the service (5)" then this error means that the service has got an access denied. Check that the account you have asked SQL Server/SQL Agent to start under has the "logon as a service" permission.

20. Make sure for upgrades that SQL Server has a name. Run sp_helpserver and check what name srvid of 0 has. If it is not there then run sp_addserver '<servername>', 'LOCAL'

21. If you're getting a 109 error starting SQL Executive then this is a permissions problem with the NT account you've supplied not having permissions to the relevant service or registry keys - HKLM\SOFTWARE\MICROSOFT\MSSQLSERVER. The easiest thing to do is install both MSSQLSERVER and SQLEXECUTIVE with the localsystem account and then go back and change it later.

22. With SQL 7.0 if you get application errors after "Setup is registering ActiveX components..." message then it is a problem with SQL putting an older version of a DLL in on machines with Visual Studio installed.

Search the hard drive for the ATL.DLL file, it will probably be in C:\WINDOWS\SYSTEM. Rename it to ATL.OLD and run the install of SQL 7.0 again. Once the install is complete, go back and rename SQL's version of ATL.DLL to ATL.SQL, and rename ATL.OLD back to ATL.DLL.

REASON:
Visual Studio installed ATL.DLL as a 68 KB file, dated 6/17/98, version
3.00.8168, product version 6.00.8168.
SQL Server 7.0 Desktop Edition installs a 21 KB file, dated 1/24/97, version
2.00.7024, product version 5.00.000.

23. If you're upgrading from MSDE to full SQL Server and the MSDE came from the Office 2000 developer edition then you may get an error "You cannot install a version which is older (7.00.623) than the version on your machine (7.00.677). Un-install the older version.". This is due to an incorrect version number being put in the registry. To fix this problem and allow setup to work amend "HKEY_LOCAL_MACHINE/Software/Microsoft/MSSQLServer/MSSQLServer/CurrentVersion" to have a value of 7.00.623. For more details see Q234915

24. If you get a 432 error then check the file "uninst.exe" in the <WINNT> directory. Make sure that you have permissions to it - take ownership of it if necessary.

25. With a 6.5 to 7.0 upgrade (or version switch) you can sometimes get a problem if registry permissions have been changed. Check that you have full permission on the following registry keys :-

HKLM\Software\Microsoft\MSSQLServer
HKLM\Software\Microsoft\MSSQLServ65
HKLM\Software\Microsoft\MSSQLServ70

Take control of the keys with regedt32.exe if necessary. Make sure that the account you are logged on as (presumably an admin account) has full permissions.

26. One or more of the preceding 25 fixes should get the setup routine run through. If it still isn't installing then check the *.OUT files in the <sql>\install directory for clues as to what is going on. Look for the one with the newest date/time.

27. If the setup seems to run ok, but then SQL won't start then try the following for SQL 6.5 and below. 
From the <sql>\binn directory run the following, making sure that the spacing and case is correct

setup /t RegistryRebuild = On

The setup routine will now run and ask you all the normal questions. Answer these as if you were performing the install again (same paths etc.) and it will just update all the registry entries/icons etc. It will leave the databases alone.

28. Once installed, if you have trouble registering your SQL Server by name in SQL EM, then just register it with a name of just a period. i.e. "." without the quotes. This again bypasses the network layer and ensures that a local named-pipe is used.