Dynamics Ax 2012 Error Code 90, Unable to connect to database

My friend Bashir Ahmad Malik got following error during start up dynamics Ax service.


“The Microsoft Dynamics AX Object Server 6.2$01-MicrosoftDynamicsAX service terminated with service-specific error Code 90.
Suspect state of SQL Server database is a state when you are unable to connect to the database. “


During trouble shooting we find following root causes.


  • database is corrupted
  • database files are being “opened” or held by some process (operating system, other program(s)…)
  • not enough disk space for SQL Server
  • insufficient memory (RAM) for SQL Server
  • unexpected SQL Server shutdown caused by power failure


we solve this problem by following Sql Script.

  1. Connect database server with Microsoft SQL Server Management Studio.
  2. Execute the following SQL script in given order:

NOTE: replace [DatabaseName] with your database name

-- This query will rollback any transaction which is running on that database

-- and bring SQL Server database in a "single user" mode



-- Marking database READ_ONLY, disable logging,

-- and limiting access only to members of the sysadmin fixed server role



-- Checks the logical and physical integrity of all the objects in the specified database

DBCC checkdb(MicrosoftDynamicsAX)


-- In case of simple failure then we can use allow data loss option to recover Database


--  DBCC CheckDB (MicrosoftDynamicsAX, REPAIR_ALLOW_DATA_LOSS)


-- Set database accessibility to it's original state, allowing all logins


EXEC sp_resetstatus MicrosoftDynamicsAX

reference : http://social.technet.microsoft.com/wiki/contents/articles/25820.repair-a-suspect-database-in-sql-server.aspx


Ali Raza Zaidi, Microsoft ERP Consultant, Currently working for Business Experts Gulf in United Arab Emirates. Specialized in HR & Payroll, Supply Chain and Financials modules.