Date: Fri, 29 Mar 2024 13:17:43 +0000 (GMT) Message-ID: <1361475489.667.1711718263425@ip-172-31-38-4.eu-west-1.compute.internal> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_666_1447776924.1711718263409" ------=_Part_666_1447776924.1711718263409 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Generates a Release Artifact containing deployment resources for a speci= fic environment.
New-DatabaseReleaseArtifact -Source <Ob=
ject> -Target <Object> [-FilterPath <string>] [-IgnoreStatic=
Data] [-SQLCompareOptions <string>] [-SQLDataCompareOptions <strin=
g>] [-IgnoreAdditional] [-TransactionIsolationLevel <TransactionIsola=
tionLevel>] [-IncludeIdenticalsInReport] [-AbortOnWarningLevel <Warni=
ngSeverity>] [-IgnoreParserErrors] [-SqlCmdVariables <hashtable>] =
[-CodeAnalysisSettingsPath <string>] [<CommonParameters>] |
The New-ReleaseArtifact cmdlet creates the database deployment resources= containing all the information you need to update a target database. The o= utput can be used by the Use-ReleaseArtifact cmdlet to update the target da= tabase, or by the Export-ReleaseArtifact cmdlet to export these resources f= or review.
-Source=
<System.Object>
The schema you want to update databases to. This can be:
- a Database Connection object created by the New-DatabaseConnection cmd= let
- a database connection string
- a path for a NuGet package or .zip file. This must contain a scripts f= older located at db\state
- a Database Build Artifact object produced by the New-DatabaseBuildArti= fact cmdlet
- a path for a scripts folder, created by SQL Compare or from your SQL S= ource Control database repository
Aliases | None |
Required? | true |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-Target=
<System.Object>
A database schema you want to update from. This can be:
- a Database Connection object created by the New-DatabaseConnection cmd= let
- a database connection string
- a path for a NuGet package or .zip file. This must contain a scripts f= older located at db\state
- a Database Build Artifact object produced by the New-DatabaseBuildArti= fact cmdlet
- a path for a scripts folder, created by SQL Compare or from your SQL S= ource Control database repository
- a list containing one or more of the above
If you use a list, the cmdlet will check that everything in the list has= the same database schema. If there are no differences in schema, the cmdle= t will create the Database Release. If there are any differences in schema,= the cmdlet will fail and inform you.
Aliases | None |
Required? | true |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-Fi=
lterPath <System.String>
The path to a .scpf filter file.
Overrides any Filter.scpf file present in the Source schema with an alte= rnative filter file to be used when generating the Update.sql change script= and in all schema comparisons.
This parameter will be ignored if the value specified is $null or empty.=
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-IgnoreStaticData <System.Management.A=
utomation.SwitchParameter>
If you use Red Gate SQL Source Control, you can flag tables that contain= static data. If you specify a scripts folder or NuGet package as the value= of Source and a database connection object or string as the value of Targe= t, by default SQL Change Automation compares the data in these tables when = generating the update script. Use this parameter to ignore static data when= comparing the databases.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
Specifies the SQL Compare options to use when creating the update script= and running pre- and post-deploy checks. SQL Change Automation applies a d= efault set of options, listed below. To include additional options, specify= a comma-delimited list of the option names (eg 'IgnoreComments, ObjectExis= tenceChecks'). To turn off a default option, precede the option name with a= minus sign (eg '-ForceColumnOrder').
This parameter will be ignored if the value specified is $null or empty.=
By default, the following Compare options are used:
- ConsiderNextFilegroupInPartitionSchemes
- DecryptPost2KEncryptedObjects
- DoNotOutputCommentHeader
- ForceColumnOrder
- IgnoreCertificatesAndCryptoKeys
- IgnoreDatabaseAndServerName
- IgnoreTSQLT
- IgnoreUsersPermissionsAndRoleMemberships
- IgnoreUserProperties
- IgnoreWhiteSpace
- IgnoreWithElementOrder
- IncludeDependencies
- ThrowOnFileParseFailed
- UseCompatibilityLevel
For more information about SQL Compare options, see http://www.red-gate.com/sca/ps/help/compareoptions.
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-SQLDataCompareOptions <System.String>
Specifies the SQL Data Compare options to use when creating the script f= or validation. To include additional options, specify a comma-delimited lis= t of the option names (eg 'DisableAndReenableDDLTriggers, CompressTemporary= Files').
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-IgnoreAdditional <System.Management.A=
utomation.SwitchParameter>
Specifies whether to ignore additional objects in the target database. E= nabling this prevents new and unexpected objects in the target being droppe= d - note that the checks and tests applied to this database may not have ta= ken those objects into account and may therefore not be valid.
This parameter can't be used simultaneously with filter files.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-Transa=
ctionIsolationLevel <RedGate.Versioning.Automation.Shared.Domain.Transac=
tionIsolationLevel>
The isolation level for the transactions used in the update script. Perm= itted values are Serializable, Snapshot, RepeatableRead, ReadCommitted and = ReadUncommitted. The default level is Serializable.
See http://msdn.microsoft.com/en-gb/libr= ary/ms173763.aspx for more details on transaction isolation levels.
Possible values: Serializable, Snapshot, RepeatableRead, ReadCommitted, = ReadUncommitted
Aliases | None |
Required? | false |
Position? | named |
Default Value | Serializable |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-IncludeIdenticalsInReport <S=
ystem.Management.Automation.SwitchParameter>
By default, the change report will show the number of identical objects,= but won't show the full SQL for each object. Use this parameter to include= the full SQL of identical objects.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-AbortOnWarningLevel &l=
t;RedGate.Versioning.Automation.Shared.Domain.WarningSeverity>
=
h3>
Use this parameter to set the minimum warning level that will cause the = release generation operation to abort.
Valid warning severity levels are:
- High
- Medium
- Low
- Information
- None (do not abort for any warnings)
The default setting is 'None'.
Possible values: Information, Low, Medium, High, None
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-IgnoreParserErrors <System.Manageme=
nt.Automation.SwitchParameter>
Tells the SQL Compare engine to ignore parser errors.
Aliases | None |
Required? | false |
Position? | named |
Default Value | False |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-SqlCmdVariables <System.Collections.Hashtable>
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
-CodeAnalysisSettingsPath <System.String>
Aliases | None |
Required? | false |
Position? | named |
Default Value | None |
Accept Pipeline Input | false |
Accept Wildcard Characters | false |
<CommonPa=
rameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorActi= on, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see= http://technet.microsoft.com/en-us/libr= ary/hh847884.aspx.
The input type is the type of the objects that you can pipe to the cmdle= t.
The output type is the type of the objects that the cmdlet emits.
|
This example shows how to use a SQL Change Automation Build Artifact as = a source.
The New-DatabaseReleaseArtifact cmdlet uses a SQL Change Automation Buil= d Artifact, DatabaseBuildArtifact.1.0.0.nupkg, as the Source parameter. The= package must have been generated from a SQL Change Automation project usin= g the New-DatabaseBuildArtifact cmdlet
The Target parameter must be a connection string or a DatabaseConnection= when using SQL Change Automation Projects.
|
This example shows how to use a SQL Source Control Build Artifact to spe= cify the source schema.
The New-DatabaseReleaseArtifact cmdlet uses a NuGet database package, My= Database.1.0.0.nupkg, as the Source parameter. The package must contain a s= cripts folder in the db\state sub-folder.
If the NuGet package includes tables that have been flagged as containin= g static data, this data will be included when generating the Release Artif= act, unless the IgnoreStaticData parameter is specified.
You can also specify a NuGet package as the Target parameter. However, i= f you do this, static data won't be deployed.
|
This example show how to create the database deployment resources using = two database connections.
The New-DatabaseConnection cmdlet creates two Database Connection object= s, $staging and $test. $staging is used to connect to the Staging database = on staging01\sql2014. $test is used to connect to the Test database on test= 01\sql2014.
The New-DatabaseReleaseArtifact cmdlet uses $test as the Source paramete= r, and $staging as the Target parameter. The cmdlet creates the database de= ployment resources that can be used to update the schema of Staging (and an= y database with the same schema as Staging) to match the schema of Test.
|
This example shows how to specify the SQL Compare options that are used = when generating the update script and running pre- and post-deploy checks.<= /p>
In this example, the $options variable specifies that IgnoreComments and= ObjectExistenceChecks should be included in addition to the default set of= SQL Compare options. The minus sign before ForceColumnOrder indicates that= this default option will be turned off.
|
This example shows how to use a specific filter file to include/exclude = database objects when generating the update script, overriding any filter f= ile present in the source schema.
MyFilter.scpf defines which database objects are considered when the upd= ate script is generated. If this update is used, the filters will also be u= sed in pre- and post-schema comparisons.
|
This example shows how to use a SQL Change Automation Build Artifact as = a source with custom SQLCMD variables specified in the form of a hashtable.=
Any necessary escaping will be performed, so take care not to double esc= ape