I have removed by accident SQLServerAgent account and now I can't get access to the database.

Connecting from SSMS throws me an error, and system log shows:

Error 26 SQLServerAgent could not be started (reason: Error creating a new session). .

How can I restore or recreate the SQL Server Agent account?

  • jackal, this is the type of questions you should ask on serverfault rather than stackoverflow. People are more proficient there for system management (in theory, here are frightening guys too ;) ) and it's not programming related.
    – Kheldar
    Sep 3, 2011 at 18:31
  • thx for suggestion. I wasnt familiar with serverfault
    – jackal
    Sep 3, 2011 at 18:45
  • possible duplicate of Removed SQLServerAgent account What should I do?
    – Wesley
    Sep 4, 2011 at 1:29

2 Answers 2


The Agent is a separate process from the SQL Server database engine. You should be able to run the SQL Server Agent under another account with the minimum privileges necessary.


This is my answer on a similar question, however on the chance that this question is not closed as an exact duplicate and for the benefit of future readers, I'll reproduce it here:

Create a new local or domain account (depending on your environment and its needs) and manually assign it the proper permissions. The MSDN article I linked to is for SQL Server 2008 R2, and you didn't mention your specific version of SQL Server. However, it makes no difference. The principle remains the same. Simply create a new account and assign it the proper permissions for your version of SQL Server. The required permissions for each service account are easily found by searching for them in the product documentation (SQL Server Books Online).

You might also want to look at the article titled "Setting Up Windows Service Accounts" on MSDN for a refresher in the general concept of service accounts and permission. Once again the article is specific to SQL Server 2008 R2, but the principles remain the same. Search for documentation for your specific product version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy