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
select from {dbname}.sys.objects
{dbname} is the name
from sys.databases
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With