Share via


SchemaCompareScriptService Class

Provides methods to analyze and display object scripts for a target database in the Object Definition window and the Update Script Tool window of Visual Studio Premium and Visual Studio Ultimate. In addition, this service can modify the structure of the target database to match the schema of the source database by creating and executing a DeploymentPlan.

Inheritance Hierarchy

System.Object
  Microsoft.Data.Schema.Tools.Compare.Schema.SchemaCompareScriptService

Namespace:  Microsoft.Data.Schema.Tools.Compare.Schema
Assembly:  Microsoft.Data.Schema.Tools (in Microsoft.Data.Schema.Tools.dll)

Syntax

'Declaration
<DatabaseSchemaProviderCompatibilityAttribute(GetType(DatabaseSchemaProvider))> _
Public Class SchemaCompareScriptService _
    Implements IExtensionInformation, IExtension
[DatabaseSchemaProviderCompatibilityAttribute(typeof(DatabaseSchemaProvider))]
public class SchemaCompareScriptService : IExtensionInformation, 
    IExtension
[DatabaseSchemaProviderCompatibilityAttribute(typeof(DatabaseSchemaProvider))]
public ref class SchemaCompareScriptService : IExtensionInformation, 
    IExtension
[<DatabaseSchemaProviderCompatibilityAttribute(typeof(DatabaseSchemaProvider))>]
type SchemaCompareScriptService =  
    class
        interface IExtensionInformation
        interface IExtension
    end
public class SchemaCompareScriptService implements IExtensionInformation, IExtension

The SchemaCompareScriptService type exposes the following members.

Constructors

  Name Description
Public method SchemaCompareScriptService Initializes a new instance of the SchemaCompareScriptService class.

Top

Properties

  Name Description
Protected property Canceled Gets or sets a value that indicates whether script service processes have been canceled.
Protected property DatabaseSchemaProvider Gets the current database schema provider.
Public property ExtensionHandle Gets the extension handle for the script service.
Public property ModelComparer Returns the current model comparer.
Public property ScriptDomGenerator When it is overridden in a derived class, gets the script document model generator for the current database schema provider.
Public property ScriptGenerator When it is overridden in a derived class, gets the script generator for the current database schema provider.
Public property UpdateScriptFileExtension
Public property UpdateScriptFileFilterDescription

Top

Methods

  Name Description
Public method Cancel Sets the Canceled property to true, which notifies any engaged processes that they have been canceled.
Protected method CreateDeploymentController Returns an ISchemaDeploymentController object.
Public method CreateExcludedElement Returns an element that is excluded from the plan by the user in the Schema Compare window of Visual Studio Premium and Visual Studio Ultimate.
Protected method CreateSchemaDeployment When overridden in a derived class, returns a SchemaDeployment object.
Public method Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method GenerateObjectDefinition Returns a script fragment object for display in the Object Definition window of Visual Studio Premium and Visual Studio Ultimate that would either create or drop the given element from the database.
Public method GenerateObjectScript Returns a script by using the provided script fragment object.
Public method GenerateUpdatePlan Generates the complete update script when called by a DatabaseSchemaProvider.
Public method GetContainingElement Returns the element that contains the script for the provided element.
Public method GetDependencyInformation
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetSchemaModelFromConnectionBasedProvider
Public method GetSchemaModelFromFileBasedProvider Returns the file-based model provider for use by the Schema Compare window of Visual Studio Premium and Visual Studio Ultimate.
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method GetUpdateTargetConfirmationMessage Returns a target confirmation message for the Schema Compare window in Visual Studio Premium and Visual Studio Ultimate.
Public method Initialize Called by the Object Definition window to initialize settings for the SchemaCompareScriptService object.
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method OnAfterCompare
Protected method OnAfterGeneratePlan Called by the GenerateUpdatePlan method to provide the DatabaseSchemaProvider access to the deployment plan and the deployment controller after the plan has been generated.
Protected method OnAfterUpdateTargetDatabase Called by the UpdateTargetDatabase method to provide the DatabaseSchemaProvider access to the parameter values after the target database has been updated.
Public method OnBeforeCompare
Protected method OnBeforeGeneratePlan Called by the GenerateUpdatePlan method to provide the DatabaseSchemaProvider access to the deployment controller before the update plan has been generated.
Protected method OnBeforeUpdateTargetDatabase Called by the UpdateTargetDatabase method to provide the DatabaseSchemaProvider access to the parameter values before the target database has been updated.
Protected method OnFinishGeneratePlan Called by the GenerateUpdatePlan method to provide the DatabaseSchemaProvider access to the deployment controller after the update plan has been generated, and after errors are collected.
Protected method OnStartGeneratePlan Called by the GenerateUpdatePlan method to provide the DatabaseSchemaProvider access to the initial provided parameter values before the update plan is generated.
Protected method RaiseSyncCanceledEvent By default, called from the UpdateTargetDatabase method.
Protected method RaiseSyncCompletedEvent Raises the SyncCompletedEvent.
Protected method RaiseSyncProgressStatusEvent Raises the SyncCompletedEvent by using the provided message and number.
Public method ResetCancel Resets the internal cancel flag to false.
Public method SetExtensionHandle Sets the extension handle to the specified value.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method UpdateTargetDatabase Called by the Update Script Tool window of Visual Studio Premium and Visual Studio Ultimate to update the target database by using the provided deployment plan and the other parameter values.
Public method UpdateTargetProject When overridden in a derived class, updates the given target project by using the other parameter values.
Public method UseMultiThreadingForModelPopulation

Top

Events

  Name Description
Public event SyncCanceledEvent Occurs when either the Cancel method or the RaiseSyncCanceledEvent method is called.
Public event SyncCompletedEvent Occurs when the RaiseSyncCompletedEvent method is called.
Public event SyncProgressStatusEvent Occurs when the RaiseSyncProgressStatusEvent method is called.

Top

Remarks

This class is one of the predefined extension points for the Schema Compare window in Visual Studio Premium and Visual Studio Ultimate. The other predefined extension point is the SchemaCompareSettingsService class.

To support a custom DatabaseSchemaProvider, you will likely require a matching custom version of this SchemaCompareScriptService class. This is especially required to override the UpdateTargetDatabase method and the UpdateTargetProject method, if you must update projects as well as databases.

Notes to Inheritors

Other classes that you must extend for a derived version of this class to support a specific DatabaseSchemaProvider:

You also have to implement the ISchemaDeploymentController interface.

For your specific implementation, you may also need to extend other classes and implement other interfaces.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

Microsoft.Data.Schema.Tools.Compare.Schema Namespace

DeploymentPlan

IExtensionInformation

IExtension

ISchemaCompareDependencyInfo

DatabaseSchemaProvider

UpdateTargetDatabase

UpdateTargetProject

Other Resources

Extending the Database Features of Visual Studio