Querying a Catalog view in a different database

  • From a management studio query window, I know I can run:

    select * from sys.objects

    from the database I'm currently connected.

    How can I run this select to a different database on the server without using the drop down and changing the database. Also, I don't want to have to utilize the USE statement.

    While connected to master, I've tried

    select * from msdb.dbo.[sys.objects]

    and

    select * from msdb.dbo."sys.objects"

    but they don't work.

  • select * from msdb.sys.objects

    sys is the schema, not dbo.

    Regards,

    Toby

  • Thank you.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply