-
Notifications
You must be signed in to change notification settings - Fork 32
Invoke SqlUpdate
mithrandyr edited this page Mar 22, 2018
·
2 revisions
Executes a query and returns number of record affected.
Executes a query against the targeted connection and returns the the number of records affected.
Mandatory = YES|NO|<default value>
Name | Type | Mandatory | Description |
---|---|---|---|
ConnectionName | String | "default" | User defined name for the connection |
Query | String | "default" | SQL statement to run. |
Parameters | Hashtable | Parameters required by the query. Key matches the parameter name, value is the value of the parameter. | |
CommandTimeout | Integer | -1 | The timeout, in seconds, for this SQL statement, defaults (-1) to the command timeout for the SqlConnection. |
Invoke-SqlUpdate -Query "TRUNCATE TABLE employees"
Invoke-SqlUpdate -Query "UPDATE employees SET salary = @val WHERE manager = @managerId" -Parameters @{val = 999999; managerId = 549}