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 | |
---|---|---|
SchemaCompareScriptService | Initializes a new instance of the SchemaCompareScriptService class. |
Top
Properties
Name | Description | |
---|---|---|
Canceled | Gets or sets a value that indicates whether script service processes have been canceled. | |
DatabaseSchemaProvider | Gets the current database schema provider. | |
ExtensionHandle | Gets the extension handle for the script service. | |
ModelComparer | Returns the current model comparer. | |
ScriptDomGenerator | When it is overridden in a derived class, gets the script document model generator for the current database schema provider. | |
ScriptGenerator | When it is overridden in a derived class, gets the script generator for the current database schema provider. | |
UpdateScriptFileExtension | ||
UpdateScriptFileFilterDescription |
Top
Methods
Name | Description | |
---|---|---|
Cancel | Sets the Canceled property to true, which notifies any engaged processes that they have been canceled. | |
CreateDeploymentController | Returns an ISchemaDeploymentController object. | |
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. | |
CreateSchemaDeployment | When overridden in a derived class, returns a SchemaDeployment object. | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
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. | |
GenerateObjectScript | Returns a script by using the provided script fragment object. | |
GenerateUpdatePlan | Generates the complete update script when called by a DatabaseSchemaProvider. | |
GetContainingElement | Returns the element that contains the script for the provided element. | |
GetDependencyInformation | ||
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetSchemaModelFromConnectionBasedProvider | ||
GetSchemaModelFromFileBasedProvider | Returns the file-based model provider for use by the Schema Compare window of Visual Studio Premium and Visual Studio Ultimate. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUpdateTargetConfirmationMessage | Returns a target confirmation message for the Schema Compare window in Visual Studio Premium and Visual Studio Ultimate. | |
Initialize | Called by the Object Definition window to initialize settings for the SchemaCompareScriptService object. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnAfterCompare | ||
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. | |
OnAfterUpdateTargetDatabase | Called by the UpdateTargetDatabase method to provide the DatabaseSchemaProvider access to the parameter values after the target database has been updated. | |
OnBeforeCompare | ||
OnBeforeGeneratePlan | Called by the GenerateUpdatePlan method to provide the DatabaseSchemaProvider access to the deployment controller before the update plan has been generated. | |
OnBeforeUpdateTargetDatabase | Called by the UpdateTargetDatabase method to provide the DatabaseSchemaProvider access to the parameter values before the target database has been updated. | |
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. | |
OnStartGeneratePlan | Called by the GenerateUpdatePlan method to provide the DatabaseSchemaProvider access to the initial provided parameter values before the update plan is generated. | |
RaiseSyncCanceledEvent | By default, called from the UpdateTargetDatabase method. | |
RaiseSyncCompletedEvent | Raises the SyncCompletedEvent. | |
RaiseSyncProgressStatusEvent | Raises the SyncCompletedEvent by using the provided message and number. | |
ResetCancel | Resets the internal cancel flag to false. | |
SetExtensionHandle | Sets the extension handle to the specified value. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
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. | |
UpdateTargetProject | When overridden in a derived class, updates the given target project by using the other parameter values. | |
UseMultiThreadingForModelPopulation |
Top
Events
Name | Description | |
---|---|---|
SyncCanceledEvent | Occurs when either the Cancel method or the RaiseSyncCanceledEvent method is called. | |
SyncCompletedEvent | Occurs when the RaiseSyncCompletedEvent method is called. | |
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
ISchemaCompareDependencyInfo