SQL Server - DECLARE and commas

10 Posts
2 Users
0 Reactions
3,306 Views
Posts: 6
Topic starter
(@tix2garr)
Member
Joined: 4 years ago
[#111]

I'm currently using 6.24.4.1 in Notepad++ and 6.24.03.30 (GUI)/6.24.03.22 (engine release) desktop version and they are both doing the same thing.

Prior to the last update or so, my DECLARE statement would look like:

DECLARE @SQL VARCHAR( MAX ) = ''
   , @SQL2 VARCHAR( MAX ) = ''
   , @Type VARCHAR( 6 ) = 'F0004'
   , @LinkToTable NVARCHAR( 150 ) = 'Something'
   , @LinkToColumn NVARCHAR( 150 ) = 'Something else'
   , @LinkValue NVARCHAR( 150 ) = ''
   , @Start VARCHAR( 2 ) = '6'
   , @NumChars VARCHAR( 2 ) = '6'
    

Line break before comma.

 

Now, however, it is doing this:

DECLARE @SQL VARCHAR ( MAX ) = ''                   ,
   @SQL2 VARCHAR ( MAX ) = ''                       ,
   @Type VARCHAR ( 6 ) = 'F0004'                    ,
   @LinkToTable NVARCHAR ( 150 ) = 'Something'      ,
   @LinkToColumn NVARCHAR ( 150 ) = 'Something else',
   @LinkValue NVARCHAR ( 150 ) = ''                 ,
   @Start VARCHAR ( 2 ) = '6'                       ,
   @NumChars VARCHAR ( 2 ) = '6'
 

I can't find any settings for DECLARE to "fix" it.  Everywhere I can find, I have line break before the comma.

Help, please.  🙂

Michael


9 Replies
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

Dear @tix2garr,

thanks for your feedback. I will investigate

Regards

Guido


Reply
Guido
Posts: 295
Admin
(@admin)
Member
Joined: 5 years ago

I found the reason for this issue.

Until now I used this option (see screenshot) to control linebreaks before/after comma for Commands like the EXEC.

grafik

Now this option is only impacting linebreaks for Parms as it is said in the Panel

I will need to add another option to control linebreak for statements

 

 


Reply
Posts: 6
Topic starter
(@tix2garr)
Member
Joined: 4 years ago

I would very much appreciate that.  🙂

Interesting side note, though...  no matter what I have checked, or not checked, in the Before Comma and After Comma checkboxes, it doesn't affect the commas in the declare statement.  Wacky.  <wry smile>

Michael


Reply
Posts: 6
Topic starter
(@tix2garr)
Member
Joined: 4 years ago

Any update on having a new parameter to handle linebreak for statements?  🙂

 

Michael


Reply
Page 1 / 2
Share: