create database
torsten.strauss
Posts: 271 Silver 3
HI!
Formatting the following statement will cause some issues:
This above statement is formatted manually.
SQL prompt will do it like this:
It would be nice to get this sorted - thanks!
Torsten
Formatting the following statement will cause some issues:
:SETVAR DataPath "C:Program FilesMicrosoft SQL ServerMSSQL13.MYSQLSERVER2016MSSQLDATA" :SETVAR LogPath "C:Program FilesMicrosoft SQL ServerMSSQL13.MYSQLSERVER2016MSSQLDATA" CREATE DATABASE MemoryOptimized ON PRIMARY --disk based objects ( NAME = MemoryOptimized_data , FILENAME = '$(DataPath)MemoryOptimized_data.mdf' , SIZE = 256MB ) --in memory objects , FILEGROUP MemoryOptimized CONTAINS MEMORY_OPTIMIZED_DATA ( NAME = MemoryOptimized_folder , FILENAME = '$(DataPath)MemoryOptimized_folder' ) --disk based objects LOG ON ( NAME = MemoryOptimized_log , FILENAME = '$(LogPath)MemoryOptimized_log.ldf' , SIZE = 128MB ); ALTER DATABASE MemoryOptimized SET RECOVERY FULL; GO
This above statement is formatted manually.
SQL prompt will do it like this:
:SETVAR DataPath "C:Program FilesMicrosoft SQL ServerMSSQL13.MYSQLSERVER2016MSSQLDATA" :SETVAR LogPath "C:Program FilesMicrosoft SQL ServerMSSQL13.MYSQLSERVER2016MSSQLDATA" CREATE DATABASE MemoryOptimized ON PRIMARY --REDGATE issue --disk based objects ( NAME = MemoryOptimized_data , FILENAME = '$(DataPath)MemoryOptimized_data.mdf' , SIZE = 256MB ) --in memory objects --REDGATE issue , FILEGROUP MemoryOptimized CONTAINS MEMORY_OPTIMIZED_DATA ( NAME = MemoryOptimized_folder --REDGATE issue , FILENAME = '$(DataPath)MemoryOptimized_folder' ) --disk based objects LOG ON --REDGATE issue ( NAME = MemoryOptimized_log , FILENAME = '$(LogPath)MemoryOptimized_log.ldf' , SIZE = 128MB --REDGATE issue ); GO
It would be nice to get this sorted - thanks!
Torsten
Comments
Thanks for reporting these issues. It looks like our list and parentheses options aren't working properly.
We'll try and get this sorted for you!
Cheers
Harry
another example of strange formatting can be observed using this statement.
Just try to format this and I am pretty sure you will see the issues.
Technical Lead, SQL Monitor
I've been looking into this issue more, and we’re considering an implementation change related to comma alignment inside indented parenthesis.
We think it makes more sense that when you align commas 'To Statement', the 'Statement' refers to the containing parenthesis, instead of the overall statement.
To use your example, this would be the formatted code :
We would be interested in your opinion of this, compared to your original example.
Any other suggestions would be greatly appreciated!
Thanks,
James
Redgate Software
good suggestion but it would be nice to align the first line with the second one if there is more than one line.
This is the same problem with the value formatting:
What do you think?
Thanks for looking into this!