SqlScriptPublishModel Class

Definition

Class for describing the set of database objects to script and how to script them

public class SqlScriptPublishModel
type SqlScriptPublishModel = class
Public Class SqlScriptPublishModel
Inheritance
SqlScriptPublishModel

Constructors

SqlScriptPublishModel(SqlConnectionInfo, String, IScriptingOptions)
SqlScriptPublishModel(SqlConnectionInfo, String, IScriptPublishOptions)

Constructor for SSMS context.

SqlScriptPublishModel(String)

Constructor with connection string (VS/Powershell)

Properties

AdvancedOptions

Advanced scripting/publishing options

AllowSystemObjects

Gets/sets the option to script system objects

DatabaseName

Currently selected database name

OutputType

Type for generate/publish script

RawScript

Get/sets raw script content which is used for clipboard/editor.

ScriptAllObjects

Flag indicating if we should script the entire database

SelectedObjects

Object list for scripting that user selected

ServerName

Server name

SkipCreateDatabase

Flag indicating if we should skip the create database statement Normally this is set based on scriptAllObjects and EngineType but there are cases where it isn't desired, mostly testing.

Methods

EnumChildrenForDatabaseObjectType(DatabaseObjectType)

Returns all children's object names and urns for the object type.

GenerateScript(ScriptOutputOptions)

Generate scripts to file, clipboard, or query window.

GetDatabaseObjectTypes()

Returns eligible database object type names.

RefreshDatabaseCache()

Refresh database object containers (such as Tables, Views, etc.)

Events

ScriptError

Error event for generate or publish script

ScriptItemsCollected

Database object items are all discovered

ScriptProgress

Progress event for generate or publish script

Applies to