abbgrade / PsSqlClient

The PowerShell SQL Client module aims to replace to the SQL Server utilities SQLCMD and BCP
https://abbgrade.github.io/PsSqlClient/
MIT License
0 stars 1 forks source link

Support for OUTPUT Parameters of Stored Procedures #12

Open abbgrade opened 2 years ago

abbgrade commented 2 years ago

Return data using an output parameter requires currently a workaround like

Invoke-TSqlCommand -Query @"
DECLARE @SalesYTDBySalesPerson money;

EXECUTE Sales.uspGetEmployeeSalesYTD  
    N'Blythe', @SalesYTD = @SalesYTDBySalesPerson OUTPUT;  

SELECT @SalesYTDBySalesPerson AS SalesYTDBySalesPerson;  
"