Comments
2 comments
-
Many thanks for your post Dave.
Can you try reformatting after selecting the option 'Indent Definition' child option of 'First Definition'?
Does that make any difference? -
Yes, I am aware of those settings and yes they make a difference, but I don't care for how it then indents the procedure parameters and parenthesis.
I think that table variables and function / procedure definitions need to be handled via separate formatting settings.
Thanks for the response.
-Dave
Add comment
Please sign in to leave a comment.
New Line on Open parenthesis of a definition
New Line on First definition
New Line on Closing parenthesis of a definition
and then format a stored procedure with a table variable, the table variable is formatted using the above settings.
CREATE PROCEDURE dbo.Test1 ( @param1 INT , @param2 INT ) AS BEGIN DECLARE @temp1 TABLE ( col1 INT, col2 INT, col3 INT, col4 INT ) SELECT * FROM @temp1 AS t1 WHERE t1.col1 = @param1 AND t1.col2 = @parm2 END GOAfter formatting
CREATE PROCEDURE dbo.Test1 ( @param1 INT , @param2 INT ) AS BEGIN DECLARE @temp1 TABLE ( col1 INT , col2 INT , col3 INT , col4 INT ) SELECT * FROM @temp1 AS t1 WHERE t1.col1 = @param1 AND t1.col2 = @parm2 END GOI don't believe that the table definition should be aligned to the left hand column like the procedure parameters. Instead I would have expected this:
CREATE PROCEDURE dbo.Test1 ( @param1 INT , @param2 INT ) AS BEGIN DECLARE @temp1 TABLE ( col1 INT , col2 INT , col3 INT , col4 INT ) SELECT * FROM @temp1 AS t1 WHERE t1.col1 = @param1 AND t1.col2 = @parm2 END GOI've tried the Indent definition option but I prefer not to indent parenthesis.
Tested using SQL Prompt 5.0.1.7 and 5.1 beta.