gpt4 book ai didi

sql-server-2008 - SQL 服务器 2008 : how to get the "Messages" tab (in Management Studio) output with powershell

转载 作者:行者123 更新时间:2023-12-01 11:57:05 25 4
gpt4 key购买 nike

我正在使用 invoke-sqlcmd 来管理我的数据库,它工作正常。我将 Management Studio 中“结果”选项卡的输出保存到日志文件中。

当我执行 BACKUP DATABASE 时,输出在“消息”选项卡上完成,我想将其保存在日志文件中。

有没有办法得到那个输出? (或者 SQL Server 2008 中存储备份进程和结果的表?)

SQL Server 2008 日志包含一些内容,但不像“消息”选项卡那样冗长。

最佳答案

Invoke-Sqlcmd does not display messages, such as the output of PRINT statements, unless you specify the Windows PowerShell -Verbose common parameter. For example:

Invoke-Sqlcmd -Query "PRINT N'abc';" -Verbose

Source

关于sql-server-2008 - SQL 服务器 2008 : how to get the "Messages" tab (in Management Studio) output with powershell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6017475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com