Share via


New-NAVApplicationDatabase

Creates a new Business Central application database.

Syntax

Default (Default)

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.

Parameter properties

Type:PSCredential
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:Latin1_General_100_CS_AS
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:False
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DatabaseLocation

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments: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.

Parameter properties

Type:String
Default value:Localhost
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

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