Skip to content

Instantly share code, notes, and snippets.

@t0nydean
Created September 27, 2012 19:43
Show Gist options
  • Save t0nydean/3796034 to your computer and use it in GitHub Desktop.
Save t0nydean/3796034 to your computer and use it in GitHub Desktop.
use of HAS_DBACCESS function
CURSOR FOR
SELECT name
FROM master.sys.databases
GROUP BY name HAVING HAS_DBACCESS(name) = 1 --funtion checks your access to each datbase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment