Has anyone adapted the sp_MSdbuseraccess SP so that users other than
sysadmins cannot see the system databases when they log in?
Thanks - Jean.
http://support.microsoft.com/default.aspx/kb/889696
--
David Portas
SQL Server MVP
--
"David Portas" <REMOVE_BEFORE_R...@acm.org> wrote in message
news:1121338336....@g44g2000cwa.googlegroups.com...
Tim S
/* Determine whether the current user has access to the
database. */
-- select @accessbit = has_dbaccess(@dbname)
select @accessbit =
CASE
WHEN DB_ID(@dbname) < 5
THEN
(
CASE
WHEN 1 = IS_SRVROLEMEMBER('sysadmin') OR
1 = IS_SRVROLEMEMBER('dbcreator') OR
1 = IS_SRVROLEMEMBER('diskadmin') OR
1 = IS_SRVROLEMEMBER('processadmin') OR
1 = IS_SRVROLEMEMBER('serveradmin') OR
1 = IS_SRVROLEMEMBER('setupadmin') OR
1 = IS_SRVROLEMEMBER('securityadmin')
THEN has_dbaccess(@dbname)
ELSE 0
END
)
ELSE has_dbaccess(@dbname)
END
<stah...@juno.com> wrote in message
news:1121389883.6...@g49g2000cwa.googlegroups.com...