1. start or stop the SQL Agent service in the query analyzer.
Start
Use master
Go
Xp_cmdshell 'net start sqlserveragent'
Stop
Use master
Go
Xp_cmdshell 'net stop sqlserveragent'
Change the service start mode from manual to automatic start Mode
Exec xp_cmdshell 'scm-Action 7-Service mssqlserver-SvcStartType 2'
You can also directly use the command line to execute the content in quotation marks.
2. Causes and handling of abnormal startup
On the surface, the SQL Server agent service is started normally, but the following error occurs when you view the job attributes and job history:
Error 14258: SQLServerAgent cannot be started. Please try again later.
Possible causes:
"Use Windows NT fiber" is selected. The specific cause is unknown.
Solution:
Enterprise Manager -- Right-click SQL instance -- properties -- Processor -- deselect "use Windows NT fiber"
Then restart the SQL service.
System Password modified
Solution:
A. My computer -- control panel -- Administrative Tools -- service -- Right-click MS SQLServer -- properties -- login identity -- select "Local SYSTEM account"
Or:
B. my computer -- control panel -- Administrative Tools -- services -- Right-click MS SQLServer -- properties -- login identity -- select "this account" -- select administrator, enter your administrator password in the password and Confirm Password.
Differences between the two:
Select the first method. The administrator password will be changed later. You do not need to adjust the password (but the system administrator is required to log on to the operating system)
An error occurred while the database was DOWN.
Solution:
Use the installation CD to reinstall the registry, select 'advanced option'-'rebuild registry ', and then proceed all the way ......