DLM Automation

New-DlmDatabaseDocumentation

New-DlmDatabaseDocumentation

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

Syntax

New-DlmDatabaseDocumentation [-InputObject] <ValidatedSchemaSource> [-TemporaryDatabaseServer <DatabaseServerConnection>] [<CommonParameters>]

New-DlmDatabaseDocumentation [-InputObject] <ValidatedSchemaSource> [-TemporaryDatabase <DatabaseConnection>] [<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.SchemaValidation.ValidatedSchemaSource>

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

Aliases None
Required?true
Position?0
Default Value None
Accept Pipeline Inputtrue (ByValue)
Accept Wildcard Charactersfalse

-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 Inputfalse
Accept Wildcard Charactersfalse

-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 Inputfalse
Accept Wildcard Charactersfalse

<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.SchemaValidation.ValidatedSchemaSource

    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.


Didn't find what you were looking for?