开发者

Powershell - Invoke-SqlCmd, retrieving PRINT statements asynchronously

开发者 https://www.devze.com 2023-04-11 05:10 出处:网络
I would like to know if it开发者_运维百科s possibly to retrieve PRINT statements from a stored procedure asynchronously?

I would like to know if it开发者_运维百科s possibly to retrieve PRINT statements from a stored procedure asynchronously?

Currently the code below, only displays all the PRINT systems once the stored procedure has been executed.


"Invoke-Sqlcmd -ServerInstance $sql_server -Username $sql_usr -Password $sql_pwd -Database $sql_db -QueryTimeout 6000 -Query "EXEC TV.StoredProdure $cob_date, $region" -Verbose"

Any assistance will be greatly appreciated.


No.

PRINT will only display once the command has completed, whether you run it from OSQL, SSMS, or Powershell.

What you CAN do is use RAISERROR to get immediate feedback:

RAISERROR('This will display immediately',0,1) WITH NOWAIT

0

精彩评论

暂无评论...
验证码 换一张
取 消