热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

我能让SSMS以编程方式切换到消息选项卡吗?-CanIgetSSMStoswitchtotheMessagestabprogramatically?

Imwritingafairlylongrunningscript,whichprintsprogressmessagesasitgoes.我正在编写一个相当长的运行脚

I'm writing a fairly long running script, which prints progress messages as it goes.

我正在编写一个相当长的运行脚本,它在运行时打印进度消息。

However, SQL Server Management Studio by default shows the resultset tab, not the messages tab, so the user will have to click the messages tab after starting the script to see the progress as it happens.

但是,SQL Server Management Studio默认显示的是resultset选项卡,而不是messages选项卡,因此用户必须在启动脚本后单击messages选项卡,以查看进展情况。

Is there a way for my script to tell SSMS to show the messages tab automatically?

我的脚本是否有办法让SSMS自动显示message选项卡?

I know SSMS will remove the resultset tab once the script is complete, since it doesn't generate any resultsets, but I want the messages tab shown immediately, not at the end.

我知道一旦脚本完成,SSMS将删除resultset选项卡,因为它不会生成任何结果集,但我希望消息选项卡立即显示,而不是在末尾。

I'm not looking for a setting within SSMS, since this script will not be run on my machine once released.

我并不是在寻找SSMS中的设置,因为这个脚本在发布后不会在我的机器上运行。

2 个解决方案

#1


2  

There is not anything that you can include in your script to change the default behavior of the SSMS IDE, you might be able to handle it with a setting, but you noted that isn't a valid solution.

在您的脚本中没有任何内容可以改变SSMS IDE的默认行为,您可能可以通过设置来处理它,但是您注意到这不是一个有效的解决方案。

#2


2  

you should forget about trying to do this in SSMS and use the sqlcmd utility

您应该忘记在SSMS中尝试这样做,并使用sqlcmd实用程序

Tutorial: sqlcmd Utility
Using SQL Server 2005 sqlcmd Utility

教程:sqlcmd实用程序,使用SQL Server 2005 sqlcmd实用程序


推荐阅读
author-avatar
斯高一耐
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有