If you are a database admin or developer you always should know and take care about, where tables are stored, how much space they consume and how data grows in the tables. One of the golden rules in SQL-Server database development is not to use the PRIMARY file group as the default location for user-tables in your... Continue Reading →
Hey Guy's here i am with my 1st SQL-Server Post! If you want to know the membership of a database role, to what other database roles the role belongs to, i have a good satatement for you.
SELECT dbrole1.name AS dbrole1_name
, dbrole2.name AS dbrole2_name
FROM sys.database_principals AS dbrole1
JOIN sys.database_role_members AS dbrm
ON dbrm.member_principal_id = dbrole1.principal_id
JOIN sys.database_principals AS dbrole2
ON dbrole2.principal_id = dbrm.role_principal_id
WHERE dbrole1.name LIKE 'myRole%'
ORDER BY dbrole1.name ASC