The SQL stored procedure runs a command from the database to run the powershell script.

DECLARE @return_value int, @ReturnValue varchar(max) EXEC @return_value = dbo.sp_runBatchFile @ReturnValue = @ReturnValue OUTPUT SELECT @ReturnValue as N'@ReturnValue' SELECT 'RESULT' = @return_value GO 

As a result, the script returns the data and we get the output as a table:
enter image description here

How to get the value from the 3rd line to assign it to the 'RESULT'?

  • one
    As an option, add the data to a temporary table, and then filter as you wish. - Nick Proskuryakov
  • Does not work. How can this be done? - netflow

0