Interface ISQLServerDDLHelper
- Namespace
- OrpheusInterfaces.Core
- Assembly
- OrpheusInterfaces.dll
SQL Server specific DDL helper definition.
public interface ISQLServerDDLHelper : IOrpheusDDLHelper
- Inherited Members
Properties
SchemaSeparator
Schema separator. Char that separates the schema name and the schema object. By default in SQL server, the separator is the dot char.
string SchemaSeparator { get; }
Property Value
Methods
AddDatabaseRoleMember(string, string)
Adds a database user to the specified role.
void AddDatabaseRoleMember(string roleName, string userName)
Parameters
ChangeDatabaseUserPassword(string, string, string)
Changes the password for an existing user.
void ChangeDatabaseUserPassword(string userName, string oldPassword, string newPassword)
Parameters
CreateDatabaseRole(string, string)
Creates a database role.
void CreateDatabaseRole(string roleName, string owner = null)
Parameters
CreateDatabaseUser(string, string)
Creates a contained database user.
void CreateDatabaseUser(string userName, string password)
Parameters
CreateSchema(string)
Creates a schema.
void CreateSchema(string schemaName)
Parameters
schemaNamestring
DatabaseRoleExists(string)
Returns true if the database role exists.
bool DatabaseRoleExists(string roleName)
Parameters
roleNamestring
Returns
DatabaseUserExists(string)
Returns true if a database user exists.
bool DatabaseUserExists(string userName)
Parameters
userNamestring
Returns
Deny(List<string>, string)
Deny permissions to a database principal.
void Deny(List<string> permissions, string databasePrincipal)
Parameters
Deny(string, string)
Deny permission to a database principal.
void Deny(string permission, string databasePrincipal)
Parameters
Deny(string, string, string)
Denies permission to a database principal for a specific schema object.
void Deny(string permission, string schemaObject, string databasePrincipal)
Parameters
DropDatabaseRole(string)
Drops a database role.
void DropDatabaseRole(string roleName)
Parameters
roleNamestring
DropDatabaseRoleMember(string, string)
Drops a database user to the specified role.
void DropDatabaseRoleMember(string roleName, string userName)
Parameters
DropDatabaseUser(string)
Drops a user.
void DropDatabaseUser(string userName)
Parameters
userNamestring
DropSchema(string)
Drops a schema.
void DropSchema(string schemaName)
Parameters
schemaNamestring
EnableContainedDatabases(bool)
Enables/disables the contained database feature on the SQL server instance. A feature supported from SQL server 2012 and later.
void EnableContainedDatabases(bool enable)
Parameters
enablebool
Grant(List<string>, string)
Grants permission to a database principal.
void Grant(List<string> permissions, string databasePrincipal)
Parameters
Grant(string, string)
Grants permission to a database principal.
void Grant(string permission, string databasePrincipal)
Parameters
Grant(string, string, string)
Grants permission to a database principal for a specific schema object.
void Grant(string permission, string schemaObject, string databasePrincipal)
Parameters
Revoke(List<string>, string, string)
Revoke permissions for a database principal.
void Revoke(List<string> permissions, string schemaObject, string databasePrincipal)
Parameters
Revoke(string, string, string)
Revoke permission for a database principal.
void Revoke(string permission, string schemaObject, string databasePrincipal)
Parameters
SchemaExists(string)
Returns true if the schema exists.
bool SchemaExists(string schemaName)
Parameters
schemaNamestring
Returns
SchemaObjectExists(string, string)
Returns true if the schema object exists in the database. A schema object can be a table,view,primary key, stored procedure, etc.
bool SchemaObjectExists(string schemaObjectName, string schemaName = null)
Parameters
Returns
SetDatabaseContainment(string, string)
Sets the containment option for a database.
void SetDatabaseContainment(string containment, string databaseName = null)