DacServices.GenerateDeployScript Method (DacPackage, String, DacDeployOptions, Nullable<CancellationToken>)

Creates a Transact-SQL script that can be used to deploy the schema of the supplied DacPackage to a database.

Namespace:  Microsoft.SqlServer.Dac
Assembly:  Microsoft.SqlServer.Dac (in Microsoft.SqlServer.Dac.dll)

Syntax

'Declaration
Public Function GenerateDeployScript ( _
    package As DacPackage, _
    targetDatabaseName As String, _
    options As DacDeployOptions, _
    cancellationToken As Nullable(Of CancellationToken) _
) As String
'Usage
Dim instance As DacServices 
Dim package As DacPackage 
Dim targetDatabaseName As String 
Dim options As DacDeployOptions 
Dim cancellationToken As Nullable(Of CancellationToken)
Dim returnValue As String 

returnValue = instance.GenerateDeployScript(package, _
    targetDatabaseName, options, cancellationToken)
public string GenerateDeployScript(
    DacPackage package,
    string targetDatabaseName,
    DacDeployOptions options,
    Nullable<CancellationToken> cancellationToken
)
public:
String^ GenerateDeployScript(
    DacPackage^ package, 
    String^ targetDatabaseName, 
    DacDeployOptions^ options, 
    Nullable<CancellationToken> cancellationToken
)
member GenerateDeployScript : 
        package:DacPackage * 
        targetDatabaseName:string * 
        options:DacDeployOptions * 
        cancellationToken:Nullable<CancellationToken> -> string
public function GenerateDeployScript(
    package : DacPackage, 
    targetDatabaseName : String, 
    options : DacDeployOptions, 
    cancellationToken : Nullable<CancellationToken>
) : String

Parameters

  • targetDatabaseName
    Type: String
    The name of the target database for deployment.
  • cancellationToken
    Type: Nullable<CancellationToken>
    The optional CancellationToken that can be used to indicate that the operation should be cancelled. Use of this object does not guarantee that the operation will be cancelled.

Return Value

Type: String
The string of Transact-SQL script used to create or update database schema based on the supplied DacPackage.

Exceptions

Exception Condition
DacServicesException

If a problem occurs during script generation.

OperationCanceledException

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

See Also

Reference

DacServices Class

GenerateDeployScript Overload

Microsoft.SqlServer.Dac Namespace