Share via


DacServices.GenerateCreateScript Method

Definition

Overloads

GenerateCreateScript(Stream, DacPackage, String, DacDeployOptions)

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

GenerateCreateScript(DacPackage, String, DacDeployOptions)

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

GenerateCreateScript(Stream, DacPackage, String, DacDeployOptions)

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

public static void GenerateCreateScript (System.IO.Stream outputStream, Microsoft.SqlServer.Dac.DacPackage package, string targetDatabaseName, Microsoft.SqlServer.Dac.DacDeployOptions options = default);
static member GenerateCreateScript : System.IO.Stream * Microsoft.SqlServer.Dac.DacPackage * string * Microsoft.SqlServer.Dac.DacDeployOptions -> unit
Public Shared Sub GenerateCreateScript (outputStream As Stream, package As DacPackage, targetDatabaseName As String, Optional options As DacDeployOptions = Nothing)

Parameters

outputStream
Stream

Stream to which to write the deployment script.

package
DacPackage

DacPackage containing schema to be deployed.

targetDatabaseName
String

Name of the target database for deployment.

options
DacDeployOptions

Instance of DacDeployOptions that specifies properties that affect various aspects of the deployment script creation.

Exceptions

If a problem occurs during script generation.

Applies to

GenerateCreateScript(DacPackage, String, DacDeployOptions)

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

public static string GenerateCreateScript (Microsoft.SqlServer.Dac.DacPackage package, string targetDatabaseName, Microsoft.SqlServer.Dac.DacDeployOptions options = default);
static member GenerateCreateScript : Microsoft.SqlServer.Dac.DacPackage * string * Microsoft.SqlServer.Dac.DacDeployOptions -> string
Public Shared Function GenerateCreateScript (package As DacPackage, targetDatabaseName As String, Optional options As DacDeployOptions = Nothing) As String

Parameters

package
DacPackage

DacPackage containing schema to be deployed.

targetDatabaseName
String

Name of the target database for deployment.

options
DacDeployOptions

Instance of DacDeployOptions that specifies properties that affect various aspects of the deployment script creation.

Returns

String of T-SQL script used to create database schema based on the supplied DacPackage.

Exceptions

If a problem occurs during script generation.

Applies to