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

Popular posts from this blog

.net - C# List<T>.Find(x=>x.Rectangle.Contains(Point)) FAIL -

iphone - Smoothing a rounded stroke in Core Graphics -

c++ - QtQuick: QQmlApplicationEngine failed to load component qrc:/main.qml:23 Invalid attached object assignment -