dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Invoke-DbaQuery - Example 9, Output from New-DbaSqlParameter not used

Open whoisbruce opened this issue 1 year ago • 1 comments

The last two lines read PS C:> New-DbaSqlParameter -SqlDbType structured -Value $inparamAsDataTable -TypeName 'dbatools_tabletype' PS C:> Invoke-DbaQuery -SqlInstance localhost -Database master -CommandType StoredProcedure -Query my_proc -SqlParameter $inparamAsDataTable

I think it should be more like PS C:> $inparamAsSQLParameter = New-DbaSqlParameter -SqlDbType structured -Value $inparamAsDataTable -TypeName 'dbatools_tabletype' PS C:> Invoke-DbaQuery -SqlInstance localhost -Database master -CommandType StoredProcedure -Query my_proc -SqlParameter $inparamAsSQLParameter

whoisbruce avatar Jan 22 '24 03:01 whoisbruce

hey @whoisbruce , thanks for the report. There's another pending PR on invoke-dbaquery so as soon as that is merged I'll push a new PR to fix the documentation issue.

niphlod avatar Jan 22 '24 07:01 niphlod