Reputation: 1259
When I’m trying to create a role then I receive the error “role exists” and I have to deleted first and repeat the process.
sys.table
to search for it?Upvotes: 2
Views: 171
Reputation: 117337
use sys.database_principals view:
select * from sys.database_principals where name = @Role_Name and type = 'R'
it's also possible to use database_principal_id:
select database_principal_id(@Role_Name)
Upvotes: 1