Formatting issue (new line and parentheses)
ogrishman
Posts: 81 Bronze 4
I have a piece of code and after formatting it using my configuration it looks like this:
https://www.dropbox.com/s/7pxbvwntac4ia ... 2.rar?dl=1
Thanks.
INSERT INTO dbo.dept ( id, name ) VALUES ( 1, N'Administration' ), ( 2, N'Sale' ), ( 3, N'HR' );
( id, name )and the parentheses after VALUES should have the same lists and parentheses configuration why id and the first left parenthesis are on the same line? Also why N'Administration' is on a new line and N'Sale' and N'HR' are not? Below is my configuration:
https://www.dropbox.com/s/7pxbvwntac4ia ... 2.rar?dl=1
Thanks.
Comments
The code are much longer now...
How to fix ?
I have no idea. I hope one of the RedGate support can help me on it.
Thanks for reporting this issue. Sorry you're having problems.
It seems like the parentheses options are clashing with the list options. Please could you post the code sample in the format you'd like it to be in? We can then make sure we get it working as expected.
Have you noticed this problem in any other statement types or is it just inserts?
Many thanks
Harry
Or at least this:
or this:
I didn't test throughly and I just happen to found this issue. Thanks harryf.
This is also a problem with Select
SELECT
ISNULL(SUM(Qty),
0)
FROM
dbo.TB_NAVI_Bin_Content
WITH ( READUNCOMMITTED )
WHERE
[Item No.] = @itemno
AND Warehouse = 2
I've had a go at trying to format the INSERT the way you'd like it. I've created a style file for each of the options you sent. You can download them here: https://files.red-gate.com/link/ShKfBxtVuVEeTYjekzlUyR
If you extract the files to your styles folder (by default this is C:Users<user>AppDataLocalRed GateSQL Prompt 7StylesV2) they should appear in the formatting styles UI.
I'm anticipating that these styles will change the formatting of other statements which might not be what you want. Please let us know if that's the case.
Cheers
Harry
Thanks for taking time to answer my questions. I tried your formatting files. These three formatting files produce the following output.
Note they are not exactly the same as I requested. The are always on separate lines. Why they are on separate lines while others are on the same line?
Regards.
Sorry that didn't help.
I don't see the same issue when testing against our latest build. Please could you try the formatting files with this version of SQL Prompt (http://download.red-gate.com/EAP/SQLPro ... .0.176.exe)? I think you should then see the same results as me.
Many thanks
Harry