Share via


DacServices.Script Method

Definition

Overloads

Script(DacPackage, String, PublishOptions)

Scripts the steps for a publish operation as a deployment script, deployment report, or both. At least one of the GenerateDeploymentScript or GenerateDeploymentReport options must be set to true. This method will not publish to the database

Script(DacPackage, DacPackage, String, PublishOptions)

Scripts the steps for a publish operation as a deployment script, deployment report, or both. At least one of the GenerateDeploymentScript or GenerateDeploymentReport options must be set to true. This method will not modify the target

Script(DacPackage, String, PublishOptions)

Scripts the steps for a publish operation as a deployment script, deployment report, or both. At least one of the GenerateDeploymentScript or GenerateDeploymentReport options must be set to true. This method will not publish to the database

public Microsoft.SqlServer.Dac.PublishResult Script (Microsoft.SqlServer.Dac.DacPackage package, string targetDatabaseName, Microsoft.SqlServer.Dac.PublishOptions publishOptions);
member this.Script : Microsoft.SqlServer.Dac.DacPackage * string * Microsoft.SqlServer.Dac.PublishOptions -> Microsoft.SqlServer.Dac.PublishResult
Public Function Script (package As DacPackage, targetDatabaseName As String, publishOptions As PublishOptions) As PublishResult

Parameters

package
DacPackage

DacPackage containing schema to be deployed.

targetDatabaseName
String

Name of the target database for deployment.

publishOptions
PublishOptions

Instance of PublishOptions that specifies what is reported back - the deployment script, deployment report, as well as how to configure various aspects of the deployment.

Returns

PublishResult, containing the script(s) and/or report if requested by the caller

Exceptions

If the value for any of the required parameters is a null reference or an empty string.

If an error occurs during deployment.

If the CancellationToken has a cancellation requested and the operation could be cancelled.

Applies to

Script(DacPackage, DacPackage, String, PublishOptions)

Scripts the steps for a publish operation as a deployment script, deployment report, or both. At least one of the GenerateDeploymentScript or GenerateDeploymentReport options must be set to true. This method will not modify the target

public static Microsoft.SqlServer.Dac.PublishResult Script (Microsoft.SqlServer.Dac.DacPackage sourcePackage, Microsoft.SqlServer.Dac.DacPackage targetPackage, string targetDatabaseName, Microsoft.SqlServer.Dac.PublishOptions publishOptions);
static member Script : Microsoft.SqlServer.Dac.DacPackage * Microsoft.SqlServer.Dac.DacPackage * string * Microsoft.SqlServer.Dac.PublishOptions -> Microsoft.SqlServer.Dac.PublishResult
Public Shared Function Script (sourcePackage As DacPackage, targetPackage As DacPackage, targetDatabaseName As String, publishOptions As PublishOptions) As PublishResult

Parameters

sourcePackage
DacPackage

DacPackage containing schema to be deployed.

targetPackage
DacPackage

DacPackage containing schema representing the target database.

targetDatabaseName
String

Name of the target database for deployment.

publishOptions
PublishOptions

Instance of PublishOptions that specifies what is reported back - the deployment script, deployment report, as we all how to configure various aspects of the deployment.

Returns

PublishResult, containing the script(s) and/or report if requested by the caller

Exceptions

If the value for any of the required parameters is a null reference or an empty string.

If an error occurs during deployment.

If the CancellationToken has a cancellation requested and the operation could be cancelled.

Applies to