DLM Automation 2

New-DlmDatabaseDocumentation

New-DlmDatabaseDocumentation

Generates documentation for the validated database schema produced by the Invoke-DlmDatabaseValidation cmdlet.

Syntax

New-DlmDatabaseDocumentation [-InputObject] <IProject> [-TemporaryDatabaseServer <DatabaseServerConnection>] [-FilterPath <string>] [-IgnoreParserErrors] [-SQLCompareOptions <string>] [<CommonParameters>]

New-DlmDatabaseDocumentation [-InputObject] <IProject> [-TemporaryDatabase <DatabaseConnection>] [-FilterPath <string>] [-IgnoreParserErrors] [-SQLCompareOptions <string>] [<CommonParameters>]

Description

The New-DlmDatabaseDocumentation cmdlet takes the output of the Invoke-DlmDatabaseValidation cmdlet and creates documentation for that schema. It creates a SchemaDocumentation object that represents the documentation of the validated schema.

You can use the New-DlmDatabasePackage cmdlet to include this documentation in the database package it creates.

In order to generate the documentation, the cmdlet creates a temporary copy of the database. By default, it uses LocalDB for this. Alternatively, you can use the TemporaryDatabaseServer parameter to specify a SQL Server instance for the temporary database. This is useful if your database uses features that aren't supported by LocalDB, such as Full-Text Search.

If you don't want to use LocalDB but don't have permission to create a database on the SQL Server instance, you can use the TemporaryDatabase parameter to specify an existing database.

Parameters

-InputObject <RedGate.DLMAutomation.Compare.Domain.Projects.IProject>

The output object of Invoke-DlmDatabaseSchemaValidation cmdlet, which represents the validated database schema.

Aliases None
Required? true
Position? 0
Default Value None
Accept Pipeline Input true (ByValue)
Accept Wildcard Characters false

-TemporaryDatabaseServer <RedGate.DLMAutomation.Compare.SchemaSources.DatabaseServerConnection>

The connection string for the temporary database server used for documentation. For example, 'Data Source=TempServer01'.

By default, DLM Automation uses LocalDB for the temporary database. However there may be some features in your database that aren't supported by LocalDB (for example, Full-Text Search). In this case, or if LocalDB is not present, use this parameter to specify an alternative SQL Server instance for the temporary database.

Using this option, DLM Automation will create a temporary, randomly-named database on the specified SQL Server instance.

You can't use this parameter in addition to the TemporaryDatabase parameter.

Aliases None
Required? false
Position? named
Default Value None
Accept Pipeline Input false
Accept Wildcard Characters false

-TemporaryDatabase <RedGate.DLMAutomation.Compare.SchemaSources.DatabaseConnection>

The details of the temporary database used for documentation. This can be:

- a database connection object that contains connection details for a database. See New-DlmDatabaseConnection for details.

- a database connection string. For example, 'Data Source=TempServer01;Initial Catalog=TempDatabase01'.

By default, DLM Automation uses LocalDB for the temporary database. If you don't want to use LocalDB and don't have permission to create a database on the SQL Server instance, use this option to specify an existing database to use for the temporary copy of the database.

If you use this parameter, all existing data on the temporary database will be lost.

You can't use this parameter in addition to the TemporaryDatabaseServer parameter.

Aliases None
Required? false
Position? named
Default Value None
Accept Pipeline Input false
Accept Wildcard Characters false

-FilterPath <System.String>

The path to a .scpf filter file.

Overrides any Filter.scpf file present in the InputObject schema with an alternative filter file to be used when documenting this schema.

This parameter will be ignored if the value specified is either $null or empty.

Aliases None
Required? false
Position? named
Default Value None
Accept Pipeline Input false
Accept Wildcard Characters false

-IgnoreParserErrors <System.Management.Automation.SwitchParameter>

Whether the SQL Compare engine should ignore parser errors.

This parameter will be ignored if the InputObject is a database connection.

Aliases None
Required? false
Position? named
Default Value False
Accept Pipeline Input false
Accept Wildcard Characters false

-SQLCompareOptions <System.String>

Specifies the SQL Compare options to use when creating the script for validation. DLM Automation applies a default set of options, listed below. To include additional options, specify a comma-delimited list of the option names (eg 'IgnoreComments, ObjectExistenceChecks'). 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

- IgnoreUsersPermissionsAndRoleMemberships

- IgnoreUserProperties

- IgnoreWhiteSpace

- IgnoreWithElementOrder

- IncludeDependencies

- ThrowOnFileParseFailed

- UseCompatibilityLevel

For more information about SQL Compare options, see http://www.red-gate.com/dlma/compareoptions.

Aliases None
Required? false
Position? named
Default Value None
Accept Pipeline Input false
Accept Wildcard Characters false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see http://technet.microsoft.com/en-us/library/hh847884.aspx.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • RedGate.DLMAutomation.Compare.Domain.Projects.IProject

    The output object of Invoke-DlmDatabaseSchemaValidation cmdlet, which represents the validated database schema.

Return values

The output type is the type of the objects that the cmdlet emits.

  • RedGate.DLMAutomation.Compare.Documentation.SchemaDocumentation

Examples

---------- EXAMPLE 1 ----------

$scriptsFolder = "C:\Work\scripts"
$validatedSchema = $scriptsFolder | Invoke-DlmDatabaseSchemaValidation
$documentation = $validatedSchema | New-DlmDatabaseDocumentation
$databasePackage = $validatedSchema | New-DlmDatabasePackage -PackageId MyDatabase -PackageVersion 1.0.0 -Documentation $documentation

This example shows how to create database documentation for a validated scripts folder using the New-DlmDatabaseDocumentation cmdlet. The New-DlmDatabasePackage cmdlet includes this documentation with the schema in the database package it creates.

---------- EXAMPLE 2 ----------

$project = "C:\Work\project\project.sqlproj"
$validatedProject = $project | Invoke-DlmDatabaseSchemaValidation
$documentation = $validatedProject | New-DlmDatabaseDocumentation
$databasePackage = $validatedProject | New-DlmDatabasePackage -PackageId MyDatabase -PackageVersion 1.0.0 -Documentation $documentation

This example shows how to create database documentation for a validated scripts folder using the New-DlmDatabaseDocumentation cmdlet. The New-DlmDatabasePackage cmdlet includes this documentation with the schema in the database package it creates.


Didn't find what you were looking for?