< Back

New-SQLConn

Sat Jan 18, 2020 9:38 am

NAME New-SQLConn



SYNTAX

New-SQLConn -server <string> -database <string> [-trustedconnection] [-credentials <pscredential>] [-WhatIf]

[-Confirm] [<CommonParameters>]



New-SQLConn -server <string> -database <string> [-sqlCredentials <pscredential>] [-WhatIf] [-Confirm]

[<CommonParameters>]





PARAMETERS

-Confirm



Required? false

Position? Named

Accept pipeline input? false

Parameter set name (All)

Aliases cf

Dynamic? false



-WhatIf



Required? false

Position? Named

Accept pipeline input? false

Parameter set name (All)

Aliases wi

Dynamic? false



-credentials <pscredential>

Windows credentials for impersonating



Required? false

Position? Named

Accept pipeline input? false

Parameter set name Trusted

Aliases None

Dynamic? false



-database <string>

What database do you want to access?



Required? true

Position? Named

Accept pipeline input? false

Parameter set name (All)

Aliases None

Dynamic? false



-server <string>

What IP or hostname do you want to connect to?



Required? true

Position? Named

Accept pipeline input? false

Parameter set name (All)

Aliases None

Dynamic? false



-sqlCredentials <pscredential>

SQL Username and Password



Required? false

Position? Named

Accept pipeline input? false

Parameter set name NonTrusted

Aliases None

Dynamic? false



-trustedconnection



Required? false

Position? Named

Accept pipeline input? false

Parameter set name Trusted

Aliases None

Dynamic? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).





INPUTS

None





OUTPUTS

System.Object



ALIASES

None





REMARKS

None





description : {@{Text=Returns a datatable that holds the selected data}}

syntax : @{syntaxItem=@{name=Read-SQLData; parameter=System.Management.Automation.PSObject[]}}

parameters : @{parameter=System.Management.Automation.PSObject[]}

examples : @{example=@{introduction=System.Management.Automation.PSObject[]; code=Read-SQLData -query "SELECT *

FROM table" -Conn $conn; remarks=System.Management.Automation.PSObject[];

title=-------------------------- EXAMPLE 1 --------------------------}}

details : @{name=Read-SQLData; description=System.Management.Automation.PSObject[]}

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

Name : Read-SQLData

Category : Function

Synopsis : Read data from SQL database

Component :

Role :

Functionality :

ModuleName : kenger.SQLData





description : {@{Text=Save or update data to a database, or run a SQL command. This command return the number of

rows affected, if $false is returned, something when wrong, try -verbose}}

syntax : @{syntaxItem=@{name=Write-SQLData; parameter=System.Management.Automation.PSObject[]}}

parameters : @{parameter=System.Management.Automation.PSObject[]}

examples : @{example=@{introduction=System.Management.Automation.PSObject[]; code=Write-SQLData -query "INSERT *

FROM table () VALUES ('aaa','bbb')" -Conn $conn; remarks=System.Management.Automation.PSObject[];

title=-------------------------- EXAMPLE 1 --------------------------}}

details : @{name=Write-SQLData; description=System.Management.Automation.PSObject[]}

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

Name : Write-SQLData

Category : Function

Synopsis : Run SQL query on a MS SQL database

Component :

Role :

Functionality :

ModuleName : kenger.SQLData





description : {@{Text=Save or update data a table, by providing a object with properties matching to the table

columns, this command gives no SQL data as result, only succeded or not}}

syntax : @{syntaxItem=@{name=Write-SQLObject; parameter=System.Management.Automation.PSObject[]}}

parameters : @{parameter=System.Management.Automation.PSObject[]}

examples : @{example=System.Management.Automation.PSObject[]}

details : @{name=Write-SQLObject; description=System.Management.Automation.PSObject[]}

xmlns:maml : http://schemas.microsoft.com/maml/2004/10

xmlns:command : http://schemas.microsoft.com/maml/dev/command/2004/10

xmlns:dev : http://schemas.microsoft.com/maml/dev/2004/10

Name : Write-SQLObject

Category : Function

Synopsis : Write / Update data to/in a SQL database

Component :

Role :

Functionality :

ModuleName : kenger.SQLData