I'm calling stored proc through a service. I wanted my stored proc to be running on a database. I've two questions
- Is sys.dm_* tables specific to a database or it is general one?
select * FROM sys.dm_exec_requests
Does above query return requests of all the databases or the current database where the query is being executed?
- If sys.dm_* specific to a database is there any way to specify the database through stored procedure. I'm aware that we cannot use
use
. andselect * FROM [dbname].sys.dm_exec_requests
isn't working it seems. It returns the result for the current DB it seems. I may be wrong here.