Code formatting visual studio and sql server
Asked Answered
L

1

7

What is the equivalent of Ctrl + K + D (Visual Studio) in Sql Server Management Studio which is use to format the code ?

Langton answered 12/9, 2011 at 8:55 Comment(3)
possible duplicate of SQL Formatting ToolUndry
Possible duplicate of SQL Formatter for SQL Management StudioAttrition
@Curt that question is now closed as a duplicate of SQL Formatter for SQL Management Studio. Plus this one at the bottom of the rabbit hole is closed too.Attrition
P
3

Upcoming SQL Server 2011 seems to have a similar feature, but previous versions doesn't have it. Click on the referenced link and you will see that;

  • Applies the indenting and space formatting for the language specified on the Formatting pane of the language in the Text Editor section of the Options dialog. Available only in the text editor. ( CTRL-K, CTRL-D )
  • Correctly indents the selected lines of code based on the surrounding lines of code ( CTRL-K, CTRL-F )
Periscope answered 12/9, 2011 at 11:1 Comment(1)
As far as I can tell, this is only for formatting XML, at least in Management Studio 17. There is no 'Formatting' pane for Transact-SQL in the options dialog, only for XMLAttrition

© 2022 - 2024 — McMap. All rights reserved.