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

DB_NAME(@dbID) returns Null #268

Open
ChristopherElliott opened this issue Apr 20, 2022 · 1 comment
Open

DB_NAME(@dbID) returns Null #268

ChristopherElliott opened this issue Apr 20, 2022 · 1 comment

Comments

@ChristopherElliott
Copy link

In my example sys.Databases lists my database_id as 6 but if I query DB_ID() it returns 5. The script uses database_id applied to DB_NAME and it returns null in my case. Googling is suggesting that this ID can't be relied upon and that the db name should be used instead.

@ChristopherElliott
Copy link
Author

Proposed a fix that seems to work for my case: #269

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

1 participant