Skip to main content
Solved

SQL Database Single user mode error


rickwenning
Vanguard
Forum|alt.badge.img+1

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!

 

View original
Did this topic help you find an answer to your question?

3 replies

Arie V
Community Manager
Forum|alt.badge.img+12
  • Community Manager
  • 999 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+1
  • Author
  • Vanguard
  • 21 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
  • 999 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!

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings