 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2166
|
|
[SA 9.1.261 Pro] - Formatting rule disregarded |
|
I've got a custom formatting rule set for ALTER PROCEDURE for SQL Server that is either disregarded when applying formatting . The rule for default is the following:
 |
 |
ALTER PROCEDURE ...
@...
,@...
WITH ...
,...
AS
<stmtList>
GO
|
Which formats the code below:
 |
 |
ALTER PROCEDURE uadmin.usp_set_foldhely_arkategoria
@foldhely_id INT,
@id_arkategoria INT,
@debug INT=NULL
AS
BEGIN
SELECT 1 AS a
END
GO
|
to
 |
 |
ALTER PROCEDURE uadmin.usp_set_foldhely_arkategoria
@foldhely_id INT
,
@id_arkategoria INT
,
@debug INT = NULL
AS
BEGIN
SELECT
1 AS a
END
GO
|
in case it does anything at all (see here).
The same rule for custom is:
 |
 |
ALTER PROCEDURE ...
@..., @...
WITH ..., ...
AS
<stmtList>
GO
|
results in:
 |
 |
ALTER PROCEDURE uadmin.usp_set_foldhely_arkategoria
@foldhely_id INT,
@id_arkategoria INT,
@debug INT=NULL
AS
BEGIN
SELECT 1 AS a
END
GO
|
which puts SELECT where it belongs but moves the commas to the ends of the lines instead of moving all arguments to a single line.
|
|
Fri Mar 17, 2017 10:34 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7949
|
|
|
|
thank you for getting back. Does this happen when you have several editors open? SSMS and SA SQL Editor open at the same time and after change something in the options? If you restart the editors, can you reproduce it on demand without changing options?
|
|
Fri Mar 17, 2017 11:02 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2166
|
|
|
|
I rarely use SQL Server Management Studio nowadays, hence I usually have only one editor open, SE. SA Options is almost always open and I apply changes rather frequently (honing snippets every second). Yet it can be reproduced at will. All I have to do is to open SE. The first time I hit Ctrl+F11 in a tab it works and never again for unselected code. Formatting selected code sometimes works sometimes does not. Applying custom formatting (Ctrl+Shift+F11) works all the time, regardless of the code to be formatted being selected or formatting the whole contents of the editor. No SQL Server Management Studio instances or SA Options is open and neither were since the startup of SE.
Tabs that are connected to MySQL or SQLite behave as expected for both Ctrl+F11 and Ctrl+Shift+F11.
|
|
Fri Mar 17, 2017 11:18 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|