Switch AX database to single mode with TSql statement

The other days I kept getting some SQL errors regarding my AX database. I wasn't sure why this started to happen, and trying to rename the database I realize I was also unable to perform any tasks in SSMS using the UI / contextual menu on it. So decided to switch the database to single user using scripts, which worked beautiful:

ALTER DATABASE MicrosoftDynamicsAX SET SINGLE_USER WITH ROLLBACK IMMEDIATE

ALTER DATABASE MicrosoftDynamicsAX MODIFY NAME = MicrosoftDynamicsAX_Bak

ALTER DATABASE MicrosoftDynamicsAX_Bak SET MULTI_USER WITH ROLLBACK IMMEDIATE

No comments:

Post a Comment