在Sql Server Management Studio Express中自动缩进一个查询是否可能?

时间:2021-03-09 03:53:41

I mean, something equivalent to Ctrl + K + D from Visual Studio that automatically indents code. Is there something in this sense?

我的意思是,类似于Visual Studio的Ctrl + K + D自动缩进代码。在这个意义上有什么东西吗?

5 个解决方案

#1


14  

By default no but you can always try a third party tools like SQL Prompt mentioned above or ApexSQL Refactor (slightly less options compared to SQL Prompt but it’s a free product) or just use online formatter.

默认情况下没有,但您可以尝试使用第三方工具,如上面提到的SQL提示符或ApexSQL重构(与SQL提示符相比,选项略少,但它是一个免费产品),或者只使用在线格式化程序。

#2


13  

Just discovered this - yet another variation on this older question which has much more activity: SQL Formatter for SQL Management Studio

刚刚发现了这一点——这是这个老问题的另一个变体,它有更多的活动:SQL Management Studio的SQL格式化程序

I personally am a big fan of the Poor Man's T-SQL Formatter / http://poorsql.com - but then I wrote it :)

我个人非常喜欢这个可怜人的T-SQL格式化程序/ http://poorsql.com——但后来我写了下来:)

#3


7  

SQL Prompt from Red Gate can do this.

来自Red Gate的SQL提示符可以做到这一点。

If you just want simple formatting online then the same technology powers FormatSQL.com

如果您只是想要在线进行简单的格式化,那么使用相同的技术就可以使用FormatSQL.com

#4


3  

SQL Pretty Printer can also reformat SQL. Available as a stand alone app or a SSMS plugin. Free to download (with a nag screen but no other apparent limitations) from http://www.dpriver.com

SQL漂亮打印机也可以重新格式化SQL。可作为一个独立的应用程序或SSMS插件。免费下载(有一个nag屏幕,但没有其他明显的限制),从http://www.dpriver.com

There is an online version at http://www.dpriver.com/pp/sqlformat.htm?ref=g_wangz

在http://www.dpriver.com/pp/sqlformat.htm?ref=g_wangz有一个在线版本

#5


0  

There is also the SQLinForm formatter. It is an automatic SQL code formatter for all major databases including ORACLE, SQL Server, DB2, UDB, Sybase, Informix, PostgreSQL, Teradata, MySQL, MS Access etc. with over 100 formatting options.It has a windows hotkey add-on, so you can use it in SSMS. Link: www.sqlinform.com

还有SQLinForm格式化程序。它是一个自动SQL代码格式化器,适用于所有主要数据库,包括ORACLE、SQL Server、DB2、UDB、Sybase、Informix、PostgreSQL、Teradata、MySQL、MS Access等,具有100多个格式化选项。它有一个windows hotkey插件,所以你可以在SSMS中使用它。链接:www.sqlinform.com

#1


14  

By default no but you can always try a third party tools like SQL Prompt mentioned above or ApexSQL Refactor (slightly less options compared to SQL Prompt but it’s a free product) or just use online formatter.

默认情况下没有,但您可以尝试使用第三方工具,如上面提到的SQL提示符或ApexSQL重构(与SQL提示符相比,选项略少,但它是一个免费产品),或者只使用在线格式化程序。

#2


13  

Just discovered this - yet another variation on this older question which has much more activity: SQL Formatter for SQL Management Studio

刚刚发现了这一点——这是这个老问题的另一个变体,它有更多的活动:SQL Management Studio的SQL格式化程序

I personally am a big fan of the Poor Man's T-SQL Formatter / http://poorsql.com - but then I wrote it :)

我个人非常喜欢这个可怜人的T-SQL格式化程序/ http://poorsql.com——但后来我写了下来:)

#3


7  

SQL Prompt from Red Gate can do this.

来自Red Gate的SQL提示符可以做到这一点。

If you just want simple formatting online then the same technology powers FormatSQL.com

如果您只是想要在线进行简单的格式化,那么使用相同的技术就可以使用FormatSQL.com

#4


3  

SQL Pretty Printer can also reformat SQL. Available as a stand alone app or a SSMS plugin. Free to download (with a nag screen but no other apparent limitations) from http://www.dpriver.com

SQL漂亮打印机也可以重新格式化SQL。可作为一个独立的应用程序或SSMS插件。免费下载(有一个nag屏幕,但没有其他明显的限制),从http://www.dpriver.com

There is an online version at http://www.dpriver.com/pp/sqlformat.htm?ref=g_wangz

在http://www.dpriver.com/pp/sqlformat.htm?ref=g_wangz有一个在线版本

#5


0  

There is also the SQLinForm formatter. It is an automatic SQL code formatter for all major databases including ORACLE, SQL Server, DB2, UDB, Sybase, Informix, PostgreSQL, Teradata, MySQL, MS Access etc. with over 100 formatting options.It has a windows hotkey add-on, so you can use it in SSMS. Link: www.sqlinform.com

还有SQLinForm格式化程序。它是一个自动SQL代码格式化器,适用于所有主要数据库,包括ORACLE、SQL Server、DB2、UDB、Sybase、Informix、PostgreSQL、Teradata、MySQL、MS Access等,具有100多个格式化选项。它有一个windows hotkey插件,所以你可以在SSMS中使用它。链接:www.sqlinform.com