tigertoolbox
tigertoolbox copied to clipboard
DB_NAME(@dbID) returns Null
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.
Proposed a fix that seems to work for my case: https://github.com/microsoft/tigertoolbox/pull/269