New-NAVApplicationDatabase

SYNOPSIS

Creates a new Business Central application database.

SYNTAX

New-NAVApplicationDatabase [-DatabaseServer <String>] -DatabaseName <String> [-DatabaseLocation <String>]
 [[-Collation] <String>] [-ApplicationDatabaseCredentials <PSCredential>] [-Force] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

Use the New-NAVApplicationDatabase cmdlet to create a new application database or initialize an existing database with the Business Central application tables.

EXAMPLES

EXAMPLE 1

New-NavApplicationDatabase -DatabaseServer .\BCDEMO -DatabaseName MyDatabase

This example creates a database.

EXAMPLE 2

New-NavApplicationDatabase -DatabaseServer .\BCDEMO -DatabaseName MyDatabase -ApplicationDatabaseCredentials (Get-Credential)

This example creates a new database using a credentials other than your Windows credentials. When you run this cmdlet, you are prompted to enter a valid username and password.

EXAMPLE 3

New-NAVApplicationDatabase -DatabaseServer . -DatabaseName MyDatabase_DK -DatabaseLocation c:\MyDatabase\DK -Collation Danish_Greenlandic_100_CS_AS

This example creates a database on a default or unnamed SQL Server instance. The database files are stored in a specified location, and the database collation is set to Danish_Greenlandic_100_CS_AS.

PARAMETERS

-ApplicationDatabaseCredentials

Specifies the username and password of a valid login account that has access to SQL Server. If you omit this parameter, your Windows credentials are used.

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Collation

Specifies the collation to assign the new database. The value must be a valid Windows collation name; otherwise, an error will occur when the Business Central Server tries to start. If you omit this parameter, the default collation that is assigned to SQL Server will be used. You cannot use this parameter to change the collation of an existing database.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 0
Default value: Latin1_General_100_CS_AS
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DatabaseLocation

Specifies the location for database files, like the MDF and LDF files.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-DatabaseName

Specifies the name to give the new database or the name of an existing empty database that you want to initialize to be a Business Central application database.

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-DatabaseServer

Specifies the name of the computer that is running SQL Server and the database instance on which you want to host the new database. You specify the value by using the format ComputerName\SQLServerInstance. The default database instance for Business Central is BCDEMO. If you are using a default or unnamed instance, you omit the SQL server instance.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: Localhost
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

System.String

By property name: DatabaseServer

System.String

By property name: DatabaseName

System.String

By property name: DatabaseLocation

System.String

By value and by property name: Collation

System.Management.Automation.PSCredential

By property name: ApplicationDatabaseCredentials

OUTPUTS

NOTES

Creating Databases
Changing the Collation