SqlScriptPublishModel 類別

定義

用來描述要編寫的資料庫物件集合以及如何編寫 script 的類別

public class SqlScriptPublishModel
type SqlScriptPublishModel = class
Public Class SqlScriptPublishModel
繼承
SqlScriptPublishModel

建構函式

名稱 Description
SqlScriptPublishModel(SqlConnectionInfo, String, IScriptingOptions)

用來描述要編寫的資料庫物件集合以及如何編寫 script 的類別

SqlScriptPublishModel(SqlConnectionInfo, String, IScriptPublishOptions)

用於 SSMS 上下文的建構器。

SqlScriptPublishModel(String)

帶有 連接字串 的建構器(VS/Powershell)

屬性

名稱 Description
AdvancedOptions

進階腳本/發佈選項

AllowSystemObjects

取得/設定系統物件腳本的選項

DatabaseName

目前選定的資料庫名稱

OutputType

產生/發佈腳本的類型

RawScript

取得/設定用於剪貼簿/編輯器的原始腳本內容。

ScriptAllObjects

標記指示是否應該對整個資料庫撰寫腳本

SelectedObjects

使用者選擇的腳本物件清單

ServerName

伺服器名稱

SkipCreateDatabase

標示是否應該跳過 create database 陳述式 通常這是根據 scriptAllObjects 和 EngineType 設定,但有些情況不理想,主要是測試時。

方法

名稱 Description
EnumChildrenForDatabaseObjectType(DatabaseObjectType)

回傳所有子物件的物件名稱和物件類型的 urns。

GenerateScript(ScriptOutputOptions)

產生腳本到檔案、剪貼簿或查詢視窗。

GetDatabaseObjectTypes()

回傳符合資格的資料庫物件類型名稱。

RefreshDatabaseCache()

刷新資料庫物件容器(例如資料表、檢視等)

事件

名稱 Description
ScriptError

產生或發佈腳本的錯誤事件

ScriptItemsCollected

資料庫物件項目全部被發現

ScriptProgress

產生或發佈腳本的進度事件

適用於