Closed Dave-Sexton-Luma closed 1 week ago
thanks @Dave-Sexton-Luma -- I'll take a look as soon as I can.
@Dave-Sexton-Luma -- the only way I can reproduce the above issue is if no changes were made. I.e. in your example if the value of @id
is say 4
and in the table table1
there are no rows where id = 4
-- so long as at least one row is affected, then the results are returned as expected. If no results are returned, then the warning will be displayed (but the warning will not prevent execution from continuing). If you don't want to see the warning, then use -WarningAction Ignore
(i.e. Invoke-SqlQuery "some query here" -WarningAction Ignore
).
I am getting the following warning when using Invoke-SqlQuery:
However, below is an example of the type of query that I am using which has an OUTPUT clause (for SQL Server or RETURNING for PostgreSQL). In this case the warning is incorrect, if I changed to Invoke-SqlUpdate then the query would not return the results only the number of records changed.