My system reinstalled the previous d: disk with sqlserver installed. After reinstalling the system, the sql service originally installed under d: could not be started. The installation CD of sqlserver was not found, so I tried to The sql service cannot be restored manually.
I tried the following:
(1). Directly run sqlservr.exe under D:Program FilesMicrosoft SQL ServerMSSQLBinn and find that it has a parameter: /c
Running as a service, you can indeed find sqlserver through Enterprise Manager after running, but it is inconvenient because to start sqlserver, you must run an additional dos interface window. I want to run it as a background service.
(2). Add the sqlserver background service through the registry:
Find HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices. Here are all the services in the system. Add an item: MSSQLSERVER and add the following key values:
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):64,00,3a,00,5c,00,50,00,52,00,4f,00,47,00,52,00,41,00,7e,00,
31,00,5c,00,4d,00,53,00,53,00,51,00,4c,00,5c,00,62,00,69,00,6e,00,6e,00,5c,
00,73,00,71,00,6c,00,73,00,65,00,72,00,76,00,72,00,2e,00,65,00,78,00,65,00,
00,00
"DisplayName"="MSSQLSERVER"
"ObjectName"="LocalSystem"
The key value of ImagesPath can also be a string value: D:Program FilesMicrosoft SQL ServerMSSQLBinnsqlservr.exe
Among them, D:Program FilesMicrosoft SQL Server is the directory of your sqlserver,
and then add subkeys under this:
Linkage
Performance
Security
Enum
restarts the computer and the MSSQLSERVER service will be added to the service.
Then, create a new management unit through mmc and add this service.
The sqlserver service manager will also detect and manage the sqlserver.
The complete reg is as follows. You can copy it, save it as a .reg file and import it into the registry.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLSERVER]
"Type"=dword:00000010
"Start"=dword:00000002
"ErrorControl"=dword:00000001
"ImagePath"=hex(2):64,00,3a,00,5c,00,50,00,52,00,4f,00,47,00,52,00,41,00,7e,00,
31,00,5c,00,4d,00,53,00,53,00,51,00,4c,00,5c,00,62,00,69,00,6e,00,6e,00,5c,
00,73,00,71,00,6c,00,73,00,65,00,72,00,76,00,72,00,2e,00,65,00,78,00,65,00,
00,00
"DisplayName"="MSSQLSERVER"
"ObjectName"="LocalSystem"
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLSERVERLinkage]
"Export"=hex(7):4d,00,53,00,53,00,51,00,4c,00,53,00,45,00,52,00,56,00,45,00,52 ,
00,00,00,00,00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLSERVERPerformance]
"Library"="d:\PROGRA~1\MSSQL\BINN\SQLCTR80.DLL"
"Collect"="CollectSQLPerformanceData"
"Open"="OpenSQLPerformanceData"
"Close"="CloseSQLPerformanceData"
"PerfIniFile"="sqlctr.ini"
"Last Counter"=dword:000010c2
"Last Help"=dword:000010c3
"First Counter"=dword:00000fae
"First Help"=dword:00000faf
"WbemAdapFileSignature"=hex:d6,a0,b9,c1,d1,85,78,63,4f,31,8b,f2,18,51,1a,5d
"WbemAdapFileTime"=hex:24,a2,b9,6d,3b,7d,c6,01
"WbemAdapFileSize"=dword:0000803b
"WbemAdapStatus"=dword:00000000
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLSERVERSecurity]
"Security"=hex:01,00,14,80,b8,00,00,00,c4,00,00,00,14,00,00,00,30,00,00,00,02,
00,1c,00,01,00,00,00,02,80,14,00,ff,01,0f,00,01,01,00,00,00,00,00,01,00,00,
00,00,02,00,88,00,06,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,
05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,
20,02,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,
00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,00,01,
00,00,01,01,00,00,00,00,00,05,0b,00,00,00,00,00,18,00,fd,01,02,00,01,02,00,
00,00,00,00,05,20,00,00,00,23,02,00,00,01,01,00,00,00,00,00,05,12,00,00,00,
01,01,00,00,00,00,00,05,12,00,00,00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSSQLSERVEREnum]
"0"="Root\LEGACY_MSSQLSERVER\0000"
"Count"=dword:00000001
"NextInstance"=dword:00000001
must be modified appropriately according to the SQL server installation of your own machine before importing. It took about 10 minutes to get it done
http://shengshuai.cnblogs.com/archive/2006/05/27/410996.html