0

'select name, len(name) as length from sys.availability_groups_cluster'

Returns some double values:

name length
AG_QBUS_MFG01 13
AG_QBUS003 20
TEST_ONLY 18
1
  • LEN returns the number of characters, DATALENGTH returns the number of bytes. And sys.objects doesn't do this: select name, len(name) from sys.objects. Are there trailing spaces? try select concat('[',name,']') name, len(name) Mar 10, 2023 at 20:06

2 Answers 2

2

An update was included in SQL Server 2022 CU10 that might address this issue:

Fixes unexpected characters that you encounter in the name column of the sys.availability_groups_cluster dynamic management view (DMV) when you use the read-scale availability group.

1

The difference is driven by cluster(s) set up. If I get the value from sys.availability_groups instead of sys.availability_groups_cluster it returns the results as expected.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.