我会把它转换成正常查询易于编辑(intellisense,错误检查,行号等):
DECLARE @someParameter tinyint SET @someParameter = 2 / *这里有一些查询* /查询越大越复杂,难度越大。当你多次来回的时候,这可能是一个痛苦的屁股,并吸收了大量的时间。
有没有一个简单的(例如,宏命令)的方式来将muh executionql转换成更方便的东西?
解决方案我不知道现有的加载项可以做这个。但是你可以创建一个:)
一些正则表达式和一些字符串连接,然后把它卖给Vinko和其他寻找这个功能的灵魂。
如果您想深入了解这一点,下面是创建SSMS插件的一些信息: sqlblogcasts/blogs/jonsayce/archive/2008/01/ 15 / building-a-sql-server-management-studio-addin.aspx
When dealing with debugging queries using Profiler and SSMS, its pretty common for me to copy a query from Profiler and test them in SSMS. Because I use parameterized sql, my queries are all sent as exec sp_executesql queries.
exec sp_executesql N'/*some query here*/', N'@someParameter tinyint', @ someParameter =2I'll take this and convert it into a normal query for ease of editing (intellisense, error checking, line numbers, etc):
DECLARE @someParameter tinyint SET @someParameter = 2 /*some query here*/Of course, the bigger and more complex the query, the harder to do this. And when you're going back and forth multiple times, it can be a pain in the ass and soak up lots of time.
Is there an easy (e.g., macro command) way to convert muh executesql into something more convenient?
解决方案I am not aware of an existing Add-In that can do this. But you could create one :)
A few regular expressions and some string concatenation and after that sell it to Vinko and other souls looking for this functionality.
If you're feeling like diving into this, here is some information on creating an SSMS addin: sqlblogcasts/blogs/jonsayce/archive/2008/01/15/building-a-sql-server-management-studio-addin.aspx
更多推荐
简单的方法来执行exec sp
发布评论