Skip to main content
Solved

SQL Database Single user mode error

  • May 2, 2025
  • 3 replies
  • 74 views

rickwenning
Vanguard
Forum|alt.badge.img+2

Hi all,

I want to anonymize data on a database. However, I cannot set my database to ‘Single User Mode’.

I get the following error: 

I saw on 

that I have to set HADR to off, however I get this message: ‘Msg 40517, Level 16, State 1, Line 2
Keyword or statement option 'hadr' is not supported in this version of SQL Server.’

 

The database is hosted on Azure. Is there a setting in Azure I need to alter?

 

Kind regards,

Rick

Best answer by Arie V

@rickwenning You need to run the disabling of HDAR on the secondary database and then perform the anonymize task on the primary database I believe.

As for not having to set the database in Single User mode: please raise a ticket in TCP for that request, as I agree that would be the better solution here!

 

This topic has been closed for replies.

3 replies

Arie V
Community Manager
Forum|alt.badge.img+12
  • Community Manager
  • 1191 replies
  • May 2, 2025

@rickwenning As also mentioned in the answer by Mark Jongeling and the Microsoft Docs you referred to: are you sure you are running this on the secondary database?

These options are supported only on secondary replicas.


rickwenning
Vanguard
Forum|alt.badge.img+2
  • Author
  • Vanguard
  • 23 replies
  • May 5, 2025

Hi ​@Arie V,

As far as I know, this is the primary database. The database is hosted on Azure. I assume the back-up settings are preventing me to set the database to Single User mode. 

Do you know a way to disable backups?

Even better: Do you know a way to anonymize the data without having to set the database to Single User mode?

Kind regards,
Rick


Arie V
Community Manager
Forum|alt.badge.img+12
  • Community Manager
  • 1191 replies
  • Answer
  • May 21, 2025

@rickwenning You need to run the disabling of HDAR on the secondary database and then perform the anonymize task on the primary database I believe.

As for not having to set the database in Single User mode: please raise a ticket in TCP for that request, as I agree that would be the better solution here!