Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can DB_NAME() ever return a different value to sys.databases.name? #3517

Closed
garyhuntddn opened this issue May 6, 2024 · 1 comment
Closed
Assignees

Comments

@garyhuntddn
Copy link
Contributor

Version of the script
dev branch

What is the current behavior?
One query uses DB_NAME(), and another uses sys.databases.name and these two results are used for exclusions. It's unlikely that DB_NAME will return a different result (but why use different techniques?)

If the current behavior is a bug, please provide the steps to reproduce.
See #3510 for a fix

What is the expected behavior?
Consistent behaviour of results

Which versions of SQL Server and which OS are affected by this issue? Did this work in previous versions of our procedures?
v2022 on Win and Linux but should effect all versions

@BrentOzar
Copy link
Member

Thanks for the pull request! Looks good, merging into the dev branch, will be in the next release with credit to you in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants