Question: 1. Create a procedure called "dropLogins". In this procedure, include the following code
Declare @Roles Table(DbRole varchar(20), MemberName varchar(50), MemberSID varchar(50));
insert into @Roles EXEC sp_HelpRoleMemberCustomerRole
The procedure sp_HelpRoleMember returns a table of users for the CustomerRole (see note below). The table is then inserted into a table variable called @Roles.
Declare a cursor for "select MemberName from @Roles" where MemberName has all the logins. Using the cursor and dynamic SQL, drop the member from the CustomerRole, drop the user and then drop the login.