Table of Contents

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

string

Methods

AddDatabaseRoleMember(string, string)

Adds a database user to the specified role.

void AddDatabaseRoleMember(string roleName, string userName)

Parameters

roleName string
userName string

ChangeDatabaseUserPassword(string, string, string)

Changes the password for an existing user.

void ChangeDatabaseUserPassword(string userName, string oldPassword, string newPassword)

Parameters

userName string
oldPassword string
newPassword string

CreateDatabaseRole(string, string)

Creates a database role.

void CreateDatabaseRole(string roleName, string owner = null)

Parameters

roleName string
owner string

CreateDatabaseUser(string, string)

Creates a contained database user.

void CreateDatabaseUser(string userName, string password)

Parameters

userName string
password string

CreateSchema(string)

Creates a schema.

void CreateSchema(string schemaName)

Parameters

schemaName string

DatabaseRoleExists(string)

Returns true if the database role exists.

bool DatabaseRoleExists(string roleName)

Parameters

roleName string

Returns

bool

DatabaseUserExists(string)

Returns true if a database user exists.

bool DatabaseUserExists(string userName)

Parameters

userName string

Returns

bool

Deny(List<string>, string)

Deny permissions to a database principal.

void Deny(List<string> permissions, string databasePrincipal)

Parameters

permissions List<string>
databasePrincipal string

Deny(string, string)

Deny permission to a database principal.

void Deny(string permission, string databasePrincipal)

Parameters

permission string
databasePrincipal string

Deny(string, string, string)

Denies permission to a database principal for a specific schema object.

void Deny(string permission, string schemaObject, string databasePrincipal)

Parameters

permission string
schemaObject string
databasePrincipal string

DropDatabaseRole(string)

Drops a database role.

void DropDatabaseRole(string roleName)

Parameters

roleName string

DropDatabaseRoleMember(string, string)

Drops a database user to the specified role.

void DropDatabaseRoleMember(string roleName, string userName)

Parameters

roleName string
userName string

DropDatabaseUser(string)

Drops a user.

void DropDatabaseUser(string userName)

Parameters

userName string

DropSchema(string)

Drops a schema.

void DropSchema(string schemaName)

Parameters

schemaName string

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

enable bool

Grant(List<string>, string)

Grants permission to a database principal.

void Grant(List<string> permissions, string databasePrincipal)

Parameters

permissions List<string>
databasePrincipal string

Grant(string, string)

Grants permission to a database principal.

void Grant(string permission, string databasePrincipal)

Parameters

permission string
databasePrincipal string

Grant(string, string, string)

Grants permission to a database principal for a specific schema object.

void Grant(string permission, string schemaObject, string databasePrincipal)

Parameters

permission string
schemaObject string
databasePrincipal string

Revoke(List<string>, string, string)

Revoke permissions for a database principal.

void Revoke(List<string> permissions, string schemaObject, string databasePrincipal)

Parameters

permissions List<string>
schemaObject string
databasePrincipal string

Revoke(string, string, string)

Revoke permission for a database principal.

void Revoke(string permission, string schemaObject, string databasePrincipal)

Parameters

permission string
schemaObject string
databasePrincipal string

SchemaExists(string)

Returns true if the schema exists.

bool SchemaExists(string schemaName)

Parameters

schemaName string

Returns

bool

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

schemaObjectName string
schemaName string

Returns

bool

SetDatabaseContainment(string, string)

Sets the containment option for a database.

void SetDatabaseContainment(string containment, string databaseName = null)

Parameters

containment string

Containment value. NONE or PARTIAL

databaseName string