From 971357722aa8e4c010d54bbc79bcbbb2d78d5884 Mon Sep 17 00:00:00 2001 From: Simone Bizzotto Date: Fri, 16 Feb 2024 13:01:57 +0100 Subject: [PATCH] Invoke-DbaQuery, fixed example for TVP --- public/Invoke-DbaQuery.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/Invoke-DbaQuery.ps1 b/public/Invoke-DbaQuery.ps1 index 34c70a1ae8..4b101cb5b1 100644 --- a/public/Invoke-DbaQuery.ps1 +++ b/public/Invoke-DbaQuery.ps1 @@ -134,8 +134,8 @@ function Invoke-DbaQuery { >> somedate = '2021-07-15T02:03:00' >> } >> $inparamAsDataTable = ConvertTo-DbaDataTable -InputObject $inparam - 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 + 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 Creates an TVP input parameter and uses it to invoke a stored procedure.