Why does Red Gate SQL Prompt add spaces / tabs between table alias and column name?
Matthew_Sontum
Posts: 26 Bronze 1
in SQL Prompt
One issue I've been having with the SQL Prompt formatter recently is that it has been inserting spaces / tabs between aliases and column names. For example:
FROM dbo.Product p
WHERE p.CategoryId = @ProductCategoryID
AND p.DateActive <= @LastDate
AND p.DateInactive >= @ArrivalDateTime
AND p.PackageOnly = 0
AND (p .BundleOnly IS NULL OR p.BundleOnly = 0)
I do not want it to do this and I can't find the setting that allows it. Also, as you can see from the example, it does not do it consistently.
FROM dbo.Product p
WHERE p.CategoryId = @ProductCategoryID
AND p.DateActive <= @LastDate
AND p.DateInactive >= @ArrivalDateTime
AND p.PackageOnly = 0
AND (p .BundleOnly IS NULL OR p.BundleOnly = 0)
I do not want it to do this and I can't find the setting that allows it. Also, as you can see from the example, it does not do it consistently.
Tagged:
Answers
Thanks for letting us know.
We've tried to replicate the issue locally but so far we've been unable to.
Would it be possible for you to send us the formatting style (either on the forums or by emailing it to us at sqlpromptteam@red-gate.com) that is throwing up the problem?
Best regards,
Krzysztof
K
Thanks for the style file. However, we still couldn't reproduce the issue.
Can you please upgrade to the latest version if not already and test again?
Tianjiao Li | Redgate Software
Have you visited our Help Center?
CREATE TABLE dbo.Product (
SupplierID INT,
ProductID SMALLINT,
CategoryId SMALLINT,
DateActive DATETIME,
DateInactive DATETIME,
PackageOnly BIT,
BundleOnly BIT,
PRIMARY KEY (SupplierID, ProductID)
);
GO
DECLARE @SupplierID INT,
@ProductCategoryID SMALLINT,
@LastDate DATETIME,
@ArrivalDateTime DATETIME;
SELECT *
FROM dbo.Product p
WHERE p.SupplierID = @SupplierID
AND p.CategoryId = @ProductCategoryID
AND p.DateActive <= @LastDate
AND p.DateInactive >= @ArrivalDateTime
AND p.PackageOnly = 0
AND (p .BundleOnly IS NULL OR p.BundleOnly = 0);
There was no difference
Thanks for the complete script.
If you uncheck 'Indent parentheses contents' , it should work as you expect.
Tianjiao Li | Redgate Software
Have you visited our Help Center?