New-DevartSQLDatabaseConnection

Synopsis

Build connection object to database.

Description

Checks that the details in a DatabaseConnection object produced by the New-DevartSqlDatabaseConnection cmdlet can be used to connect to the specified database. If Test-DevartDatabaseConnection can’t connect to the database, it raises an error.

Syntax

New-DevartSqlDatabaseConnection [-Server] <string> [-Database] <string> [[-UserName] <string>] [[-Password] <string>] [[-WindowsAuthentication] <SwitchParameter>] [[-ConnectionTimeout] <int>] [<CommonParameters>]

Description

Returns DevartDatabaseConnectionInfo object.

Parameters

-Server <string>

Name or network address of the SQL Server instance to connect to.

Required? true

Position? 1

Accept pipeline input? false

Accept wildcard characters? false

-Database <string>

Database to connect to on the server specified in Server parameter.

Required? true

Position? 2

Accept pipeline input? false

Accept wildcard characters? false

-UserName <string>

User name for the SQL Server account that cmdlets will use to connect to the database.

Required? false

Position? 3

Accept pipeline input? false

Accept wildcard characters? false

-Password <string>

Password for the SQL Server account that cmdlets will use to connect to the database.

Required? false

Position? 4

Accept pipeline input? false

Accept wildcard characters? false

-WindowsAuthentication <SwitchParameter>

Allows a user to connect through a Windows user account to a server.

Required? false

Position? 5

Default value false

Accept pipeline input? false

Accept wildcard characters? false

-ConnectionTimeout <int>

The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.

Required? false

Position? 6

Default value 15

Accept pipeline input? false

Accept wildcard characters? false

Outputs

Devart.DbForge.DevOpsAutomation.SqlServer.DevartDatabaseConnectionInfo

Examples

---------- EXAMPLE 1 ----------
$connection = New-DevartSqlDatabaseConnection -Server $serverName -Database $database -UserName $userName -Password $password

See web documentation for a default values for the parameters.