sql - Check if role exists in DB? -
I want to add users to the same role in multiple databases. Although the role can not be present in all the databases, how can I check whether the role is present in the database and if it connects users in that role?
For example, if the role exists, add the user to the role AD
Try:
If DATABASE_PRINCIPAL_ID ('role') is started tap - Add user here Create role role authorization MyUser; END
Comments
Post a Comment