Is it possible to get a list of all jobs that access a database in SQL? I can't figure a way to do this. I can get a list of all jobs but not what dbs they access.
This is what I use:
This will return the database name in the 2nd column.
This will work for Agent jobs that have TSQL job steps pointing to a database.
This, however, will not catch things where databases are accessed from fully qualified name references in code. Nor will it catch other things like SSIS job steps where the package references your database.