Set-SqlData

Executes a query that does not return a result set.

Syntax

Set-SqlData [[-sqlserver] <Object>] [-dbname] <String> [-qry] <String> [<CommonParameters>]

Detailed Description

The Set-SqlData function executes a query that does not return a result set.

Related Commands

* Set-SqlData

Parameters

Name Description Required? Pipeline Input Default Value
sqlserver    false  false   
dbname    true  false   
qry    true  false   

Input Type

None You cannot pipe objects to Set-SqlData

Return Values

None Set-SqlData does not produce any output.

Examples

EXAMPLE 1

Set-SqlData "Z002\sql2K8" "pubs" "Update authors set au_lname = 'Brown' WHERE au_lname = 'White'"
This command executes the specified SQL query using Windows authentication.

EXAMPLE 2

$server = Set-SqlServer "Z002\sql2K8" "sa" "Passw0rd"
Set-SqlData $server "pubs" "Update authors set au_lname = 'Brown' WHERE au_lname = 'White'"
This command executes the specified SQL query using SQL authentication.