使用Invoke-Expression
sqlcmd -i script.sql
时似乎只显示返回的前 2 行。
当我在查询分析器中运行它返回的脚本时:
(2 rows affected)
Changed database context to 'ShopStore'.
(5 rows affected)
Changed database context to 'ShopStore'.
但是从 PowerShell 我只得到:
(2 rows affected)
Changed database context to 'ShopStore'.
然而,整个事情正在运行,我可以通过玩结果来看到这一点。为什么是这样?