共用方式為


SchemaCompareScriptService.GenerateUpdatePlan 方法

DatabaseSchemaProvider 呼叫時,產生完整的更新指令碼。

命名空間:  Microsoft.Data.Schema.Tools.Compare.Schema
組件:  Microsoft.Data.Schema.Tools (在 Microsoft.Data.Schema.Tools.dll 中)

語法

'宣告
Public Overridable Sub GenerateUpdatePlan ( _
    comparisonResult As ModelComparisonResult, _
    source As DataSchemaModel, _
    target As DataSchemaModel, _
    excludedElements As HashSet(Of IModelElement), _
    sourceModelProvider As ISchemaCompareModelProvider, _
    targetModelProvider As ISchemaCompareModelProvider, _
    configurationOptions As SchemaDeploymentOptions, _
    <OutAttribute> ByRef plan As DeploymentPlan, _
    <OutAttribute> ByRef errorsAndWarnings As ErrorManager _
)
public virtual void GenerateUpdatePlan(
    ModelComparisonResult comparisonResult,
    DataSchemaModel source,
    DataSchemaModel target,
    HashSet<IModelElement> excludedElements,
    ISchemaCompareModelProvider sourceModelProvider,
    ISchemaCompareModelProvider targetModelProvider,
    SchemaDeploymentOptions configurationOptions,
    out DeploymentPlan plan,
    out ErrorManager errorsAndWarnings
)
public:
virtual void GenerateUpdatePlan(
    ModelComparisonResult^ comparisonResult, 
    DataSchemaModel^ source, 
    DataSchemaModel^ target, 
    HashSet<IModelElement^>^ excludedElements, 
    ISchemaCompareModelProvider^ sourceModelProvider, 
    ISchemaCompareModelProvider^ targetModelProvider, 
    SchemaDeploymentOptions^ configurationOptions, 
    [OutAttribute] DeploymentPlan^% plan, 
    [OutAttribute] ErrorManager^% errorsAndWarnings
)
abstract GenerateUpdatePlan : 
        comparisonResult:ModelComparisonResult * 
        source:DataSchemaModel * 
        target:DataSchemaModel * 
        excludedElements:HashSet<IModelElement> * 
        sourceModelProvider:ISchemaCompareModelProvider * 
        targetModelProvider:ISchemaCompareModelProvider * 
        configurationOptions:SchemaDeploymentOptions * 
        plan:DeploymentPlan byref * 
        errorsAndWarnings:ErrorManager byref -> unit 
override GenerateUpdatePlan : 
        comparisonResult:ModelComparisonResult * 
        source:DataSchemaModel * 
        target:DataSchemaModel * 
        excludedElements:HashSet<IModelElement> * 
        sourceModelProvider:ISchemaCompareModelProvider * 
        targetModelProvider:ISchemaCompareModelProvider * 
        configurationOptions:SchemaDeploymentOptions * 
        plan:DeploymentPlan byref * 
        errorsAndWarnings:ErrorManager byref -> unit 
public function GenerateUpdatePlan(
    comparisonResult : ModelComparisonResult, 
    source : DataSchemaModel, 
    target : DataSchemaModel, 
    excludedElements : HashSet<IModelElement>, 
    sourceModelProvider : ISchemaCompareModelProvider, 
    targetModelProvider : ISchemaCompareModelProvider, 
    configurationOptions : SchemaDeploymentOptions, 
    plan : DeploymentPlan, 
    errorsAndWarnings : ErrorManager
)

參數

備註

這是此方法的基本流程圖:

  1. 呼叫 OnStartGeneratePlan 方法。

  2. 如果您要建立資料庫的部署計劃:

    1. 呼叫 CreateDeploymentController 方法。

    2. 呼叫 OnBeforeGeneratePlan 方法。

    3. 以您的衍生部署控制器的 ISchemaDeploymentController.CreatePlan 方法來建立計劃。

    4. 請呼叫 OnAfterGeneratePlan

    5. 使用您的衍生部署控制器的 ISchemaDeploymentController.VerifyPlan 方法驗證計劃。

    6. 記錄 ErrorManager 中的任何例外狀況

  3. 呼叫 OnFinishGeneratePlan 方法。

.NET Framework 安全性

請參閱

參考

SchemaCompareScriptService 類別

Microsoft.Data.Schema.Tools.Compare.Schema 命名空間

ModelComparisonResult

DataSchemaModel

IModelElement

ISchemaCompareModelProvider

SchemaDeploymentOptions

DeploymentPlan

ErrorManager