Should be easy, but I can’t get it.
I want to filter the sys.objects results by database (either name or id). I thought I had to join with sys.databases, but does not seem to be possible. I went to SQL Servers docs but did not find anything that could help.
What am I missing?
Each Database have its own sys.objects, so you have to get the databases from sys.databases, and
{dbname} is the
namefrom sys.databases