Wer*_*rCD 19 sql-server ssms sql-server-2012
是否有任何工具可与SSMS Tools Pack 2012相媲美?许可(每台机器 30 美元,任意数量的机器 100 美元……3 个月)还有很多不足之处,我不确定还有哪些其他选项可用。
例如,我真正怀念的一件事是“保存您运行的每个查询”。在修修补补和研究时,在运行不同版本的查询时进行备份是非常宝贵的。或者当我意识到我没有 2 个月前正在处理的查询的备份时。
说明:SQL Server Management Studio 没有官方插件支持,但有一些工具。SSMS Tools Pack 是我非常喜欢的一个(2005、2008 版本),但是 2012 年的许可费太可怕了。(我会为合理的许可证付费,但这不是这里的问题。)
例如,我发现SSMS Boost对SSMS有一些很酷的补充,这似乎是值得的。
SQL Server 2012 还有哪些其他插件可用?我希望有一些东西可以在我点击 F5 时像 SSMS 工具包那样保存查询,或者除了列出的两个工具之外的任何东西?
And*_*ich 11
来自 SSMSBoost 开发人员的更多信息。你一提到我的项目,我就允许自己写一些关于这个项目的词。我编写该工具的主要原因是我错过了有关 T-SQL 开发和面向 DBA 的任务的生产力功能。例如:
所有这些和其他一些日常操作都在 SSMSBoost 中得到解决并不断改进。目前我每 30-40 天发布一次新版本。在过去的 3 个版本中,我也得到了很多积极/建设性的用户反馈,并且改进了很多功能。您保存每个已执行查询的建议也将很快实施。正如我写的 - 如果你想有什么特别的,给我写一封电子邮件(support@ssmsboost.com)
我以为我会玩这个,并且为了实现在 SQL Server 2012 SSMS 上运行的“保存您运行的每个查询”的既定目标,这似乎可以在我的机器上完成工作(添加您自己的错误处理/测试/ 重构)
它基于Andrei 的示例项目,并Connect替换了该类。Codeplex 上的SSMSAddin2012 项目也非常有用。
namespace SSMSAddin
{
using System;
using System.IO;
using System.Windows.Forms;
using EnvDTE;
using EnvDTE80;
using Extensibility;
using Microsoft.SqlServer.Management.UI.VSIntegration;
public class Connect : IDTExtensibility2
{
private DTE2 application;
private CommandEvents executeSqlEvents;
public void OnConnection(object application, ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
this.application = (DTE2)application;
this.executeSqlEvents = this.application.Events.CommandEvents["{52692960-56BC-4989-B5D3-94C47A513E8D}", 1];
this.executeSqlEvents.BeforeExecute += this.executeSQLEvents_BeforeExecute;
}
private void executeSQLEvents_BeforeExecute(string guid, int id, object customin, object customout, ref bool canceldefault)
{
try
{
Document document = ((DTE2)ServiceCache.ExtensibilityModel).ActiveDocument;
var textDocument = (TextDocument)document.Object("TextDocument");
string queryText = textDocument.Selection.Text;
if(string.IsNullOrEmpty(queryText))
{
EditPoint startPoint = textDocument.StartPoint.CreateEditPoint();
queryText = startPoint.GetText(textDocument.EndPoint);
}
DateTime now = DateTime.Now;
string folderPath = string.Format(@"E:\SSMS Queries\{0}", now.ToString("yyyyMMdd"));
string fileName = now.ToString("HHmmss-FFFFFFF") + ".sql";
Directory.CreateDirectory(folderPath);
string fullPath = Path.Combine(folderPath, fileName);
File.WriteAllText(fullPath, queryText);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
#region Other Interface Methods
public void OnDisconnection(ext_DisconnectMode disconnectMode, ref Array custom) { }
public void OnStartupComplete(ref Array custom) { }
public void OnAddInsUpdate(ref Array custom) { }
public void OnBeginShutdown(ref Array custom) { }
#endregion
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22434 次 |
| 最近记录: |