 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
Formatting issues |
|
Given is the following code fragment:
 |
 |
CREATE DATABASE database_name ON ((NAME = logical_file_name1 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB) ,(NAME = logical_file_name2 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB)) LOG ON ((NAME = logical_file_name3 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB))
|
and the following two formatting rule:
#1 (...)
 |
 |
(
...
,...
AND ...
OR ...
)
|
#2 create database
 |
 |
CREATE DATABASE ... ON
(
(NAME = ... ,FILENAME = ... ,FILEGROWTH = ...)
,...
)
LOG ON (
(NAME = ... ,FILENAME = ... ,FILEGROWTH = ...)
,...
)
COLLATE ...
|
Other formatting settings (in case they're relevant) are set as:
Line Length for Code Wrapping = 230
Line Length for DDL Code Wrapping = 120
Name Length for Aligning = 96
When both rules are enabled, the formatted result is:
 |
 |
CREATE DATABASE database_name ON
(
(
NAME = logical_file_name1 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB)
,(NAME = logical_file_name2 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB)
)
LOG ON (
(
NAME = logical_file_name3 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB)
)
|
and according to rule #2 this is obviously not what I want.
When rule #2 is disabled, formatting the code makes no changes to it. That's kind of expected.
When rule #1 is disabled, formatting the code results in code loss!!! The second file (logical_file_name2) is formatted into oblivion!
 |
 |
CREATE DATABASE database_name ON
(
( NAME = logical_file_name1
,FILENAME = 'os_file_name'
,FILEGROWTH = 10 MB
)
)LOG ON ((NAME = logical_file_name3 ,FILENAME = 'os_file_name' ,FILEGROWTH = 10 MB))
|
Changing the order of rules makes no difference. The last outcome is frightening, though.
I fiddled with rules for a while but found no constellation of rules that would yield a result corresponding to rule #2. I guess the whitespaces between NAME and = are because of the Name Length for Aligning setting, and I don't really care about that. But this tossing of parenthesis is highly undesired. Any hints to how to avoid that?
Last edited by gemisigo on Tue Sep 04, 2018 4:34 pm; edited 1 time in total |
|
Wed Aug 29, 2018 5:32 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Thank you for the detailed description. I have created a ticket for that issue with reference #SA0034588
|
|
Wed Aug 29, 2018 7:07 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Having only one file for data also causes the formatting to drop some characters. The code below
 |
 |
CREATE DATABASE DATAHOUSE_2016_Q1
ON ( NAME = DATAHOUSE_2016_Q1, FILENAME = 'M:\gfsqlArchive\DATAHOUSE_2016_Q1_data.mdf', FILEGROWTH = 10 MB )
LOG ON (NAME = 'DATAHOUSE_2016_Q1_log', FILENAME = 'M:\gfsqlArchive\DATAHOUSE_2016_Q1_log.ldf', FILEGROWTH = 10 MB);
GO
ALTER DATABASE DATAHOUSE_2016_Q1 SET RECOVERY SIMPLE;
GO
|
formats to:
 |
 |
CREATE DATABASE DATAHOUSE_2016_Q1 ON
(
NAME = DATAHOUSE_2016_Q1 ,FILENAME = 'M:\gfsqlArchive\DATAHOUSE_2016_Q1_data.mdf' ,FILEGROWTH = 10 MB)
LOG O
(
NAME = 'DATAHOUSE_2016_Q1_log'
,FILENAME = 'M:\gfsqlArchive\DATAHOUSE_2016_Q1_log.ldf'
,FILEGROWTH = 10 MB
)
;
GO
ALTER DATABASE DATAHOUSE_2016_Q1
SET RECOVERY SIMPLE
;
GO
|
The LOG ON part lost its last character (N)
|
|
Thu Aug 30, 2018 6:54 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
Quick status update, this ticket is still open, still waiting for the development team to figure out the cause and provide their response. It doesn't seem like a new issue. They are currently very busy with beta version related stuff.
|
|
Tue Sep 04, 2018 10:13 am |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
Okay, I'll remove the Beta and version from the title to avoid confusion.
|
|
Tue Sep 04, 2018 4:33 pm |
|
 |
|
|
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
|
|
|