SHARE
TWEET

Untitled

a guest Jun 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --msdb query
  2.  
  3.     select
  4.         case
  5.             when object_id('dbo.sysdac_instances') is not null then 1            
  6.         else
  7.             0
  8.         end
  9.  
  10. --master query
  11.  
  12. SELECT
  13. dtb.name AS [Name],
  14. dtb.database_id AS [ID],
  15. CAST(has_dbaccess(dtb.name) AS bit) AS [IsAccessible]
  16. FROM
  17. master.sys.databases AS dtb
  18. ORDER BY
  19. [Name] ASC
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top