Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #329: DATABASEPROPERTYEX( DB_NAME() ,  'Updateability' ) and db_datareader role

Jose_Manuel_Jurado's avatar
Feb 13, 2023

Today, we got a question where our customer asked that if using ApplicationIntent=ReadWrite with an user with db_datareader permision, the results of DATABASEPROPERTYEX(DB_NAME(), 'Updateability') will be affected or not.

 

In this situation, let's try to create a business critical database with readscale out enabled and create the following user. Right now, the answer is not affected.

 

 

create user UserName with password = 'PasswordX2X3X1!'
alter role db_datareader add member UserName

 

 

Once we have established the connection using SQL SERVER Management Studio using this user and execute the query

 

 

SELECT DATABASEPROPERTYEX(DB_NAME(), 'Updateability');

 

 

The results will be:

 

 

However, using applicationIntent=Readonly with the same user the results will be the expected one:

 

 

Additionaly, I would like to share an article that explain the behaviour when we are using Transparent Failover Group and ApplicationIntent at the same time - Lesson Learned #131: ReadScale Out and Failover Group - Microsoft Community Hub

 

Enjoy!

Updated Feb 13, 2023
Version 3.0
No CommentsBe the first to comment