MS SQL Datatypes and lineshift

10 Posts
3 Users
1 Likes
279 Views
(@jmelhus)
Member
Joined: 2 years ago
Posts: 4
Topic starter  

Hi,

Thanks for a great plugin, I've purchased the pro version!

 

I did an upgrade to the latest version and have some problems I hope to get resolved. I have version 6.0.2.8 (64 bit) with Notepad++ version 8.1.9.3 (64 bit). It's regarding MS SQL.

 

This is example code:

CREATE TABLE _TempTable
(
Column1_asdasdasdasdasdasdasdasdasdasd VARCHAR(256) NOT NULL,
Column2 NVARCHAR(100) NOT NULL,
Column3 NVARCHAR(100) NOT NULL,
Column4 NVARCHAR(100) NOT NULL,
Column5 NVARCHAR(100) NOT NULL,
Column6 NVARCHAR(100) NOT NULL,
Column7 DATETIME2 NULL,
Column8 INT NULL,
Column9 DATETIME2 NULL,
Column10 INT NULL,
Column11 UNIQUEIDENTIFIER NOT NULL,
CONSTRAINT UC_Column11 UNIQUE(Column11),
Column12 BIT,
Column13 BIT,
Column14 BIT,
Column15 DATETIME2 NULL
)
INSERT INTO
_TempTable(
Column2
)
SELECT
Column2
FROM _OtherTempTable O
INNER JOIN _OtherTempTable2 PB
WITH (NOLOCK
)

See attached file on how its formatted.

It does not recognize DATETIME2, UNIQUEIDENTIFIER or BIT as datatype as far as I can see, and therefore not indenting correctly.

Also I have specified to not do a lineshift after INSERT INTO, but it does.

How can I avoid lineshift before query hint WITH?

Thanks!

 

Regards,

jmelhus

 sqlinform

   
Guido reacted
Quote
(@guidomarcel)
Member
Joined: 2 years ago
Posts: 9
 

Hi melhus,

thanks for your feedback.

I will add DATETIME2 and UNIQUEIDENTIFIER  as datatype 

the current option INTO relates to FETCH .... INTO

I will add a new Option for linebreak after INSERT INTO

REgards

Guido

This post was modified 2 years ago by Guido

   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

@jmelhus, datatype added to the new release. Will do some testing and publish shortly


   
ReplyQuote
(@jmelhus)
Member
Joined: 2 years ago
Posts: 4
Topic starter  

Thank you very much! 


   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

@jmelhus please download the new version 6.0.3.3 64-bit and give it a try

DATETIME2 and UNIQUEIDENTIFIER have been added. BIT was already in the list of variable types

The reason why the BIT keyword is not indented is that the line with the CONSTRAINT keyword which does precedd the lines with BIT keywords does not contain a variable type. The var types of Consecutive lines are aligned.


   
ReplyQuote
(@jmelhus)
Member
Joined: 2 years ago
Posts: 4
Topic starter  

Thank you, it works! Did you also have time to look at query hints with select?

SELECT Col_1 AS Test FROM TestTable TT WITH (NOLOCK)

 

Is formatted like the attached image.

How can I control format of query hints like WITH?

I would like to keep the query hint with keyword and parenthesis on the same line as the FROM.

 

 sqlinform2

   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

@jmelhus that is a parsing error. I will fix this

Regards

Guido


   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

@jmelhus error has been fixed with release 6.0.4.1

 

 releae6.0.4.1

   
ReplyQuote
(@jmelhus)
Member
Joined: 2 years ago
Posts: 4
Topic starter  

@admin Thanks! I can only find the new version as 32-bit, would you please publish as 64-bit as well? Thanks in advance!


   
ReplyQuote
Guido
(@admin)
Member Admin
Joined: 2 years ago
Posts: 175
 

@jmelhus Ok, please try again. I forgot to upload the 64bit version

This post was modified 2 years ago by Guido

   
ReplyQuote
Share: