akhila
2007-06-01 11:44:41 UTC
Hi All,
I need information on how to check if a user is a DBA in SQL Server.
In Oracle we can achieve the result by using the following query
ResultSet rs = stmt.executeQuery("select GRANTEE from
DBA_ROLE_PRIVS where " +
"GRANTED_ROLE='DBA' " +
"and GRANTEE='" + userName.toUpperCase() + "'" );
if(rs.next()) {
//user is a DBA
}
How do we find out for SQL Server Database.
Thanks in advance.
I need information on how to check if a user is a DBA in SQL Server.
In Oracle we can achieve the result by using the following query
ResultSet rs = stmt.executeQuery("select GRANTEE from
DBA_ROLE_PRIVS where " +
"GRANTED_ROLE='DBA' " +
"and GRANTEE='" + userName.toUpperCase() + "'" );
if(rs.next()) {
//user is a DBA
}
How do we find out for SQL Server Database.
Thanks in advance.