What are the challenges you face when working across database platforms? Take the survey
Options

Format INSERT INTO...EXECUTE

ogrishmanogrishman Posts: 81 Bronze 4
edited July 12, 2016 6:05AM in SQL Prompt
This is my format settings (you can import into SQL Prompt):
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!---->
<LayoutOptions version="1" type="LayoutOptions">
  <ReservedWordsCasing>1</ReservedWordsCasing>
  <BuiltInFunctionCasing>1</BuiltInFunctionCasing>
  <BuiltInDataTypeCasing>1</BuiltInDataTypeCasing>
  <GlobalVariableCasing>1</GlobalVariableCasing>
  <DelimitIdentifiers>False</DelimitIdentifiers>
  <IndentationAmount>4</IndentationAmount>
  <TabIndentingBehaviour>0</TabIndentingBehaviour>
  <ReformatExpressions>True</ReformatExpressions>
  <FirstColumnOnNewLine>False</FirstColumnOnNewLine>
  <CommasAtStart>False</CommasAtStart>
  <MultilineSpacesAfterCommas>False</MultilineSpacesAfterCommas>
  <MultilineSpacesBeforeCommas>False</MultilineSpacesBeforeCommas>
  <MultilineAlignCommasWithStatement>True</MultilineAlignCommasWithStatement>
  <OperatorsOnNewline>True</OperatorsOnNewline>
  <OperatorsAtStart>True</OperatorsAtStart>
  <IndentBeginToken>False</IndentBeginToken>
  <IndentWithExpressionBrackets>True</IndentWithExpressionBrackets>
  <IndentWithParameterBrackets>True</IndentWithParameterBrackets>
  <IndentWithQueryBrackets>True</IndentWithQueryBrackets>
  <CloseBracketsOnNewLine>True</CloseBracketsOnNewLine>
  <OpenBracketsOnNewLine>True</OpenBracketsOnNewLine>
  <Wrap>True</Wrap>
  <WrapWidth>160</WrapWidth>
  <ShortLength>15</ShortLength>
  <CreateBracketsAtStartOfLines>True</CreateBracketsAtStartOfLines>
  <ParameterBracketOnNewline>True</ParameterBracketOnNewline>
  <CloseParameterBracketsOnNewLine>True</CloseParameterBracketsOnNewLine>
  <CompactShortStatements>False</CompactShortStatements>
  <SinglelineSpacesAfterCommas>True</SinglelineSpacesAfterCommas>
  <SinglelineSpacesBeforeCommas>False</SinglelineSpacesBeforeCommas>
  <SpacesAroundOperators>True</SpacesAroundOperators>
  <SpacesAroundComparisons>True</SpacesAroundComparisons>
  <FirstParameterDefinitionOnNewLine>True</FirstParameterDefinitionOnNewLine>
  <SpacesAfterBrackets>False</SpacesAfterBrackets>
  <LayoutSelectStatements>True</LayoutSelectStatements>
  <LayoutCreateStatements>True</LayoutCreateStatements>
  <QueryNewlineAfterOpenBracket>True</QueryNewlineAfterOpenBracket>
  <QueryNewlineBeforeCloseBracket>True</QueryNewlineBeforeCloseBracket>
  <JoinConditionsOnNewline>True</JoinConditionsOnNewline>
  <AlignConditionsWithJoins>False</AlignConditionsWithJoins>
  <AlignJoinsWithFrom>False</AlignJoinsWithFrom>
  <AlignSelectWithInsert>True</AlignSelectWithInsert>
  <IndentByKeywordWidth>False</IndentByKeywordWidth>
  <ColumnsOnSingleLine>False</ColumnsOnSingleLine>
  <DoNotIndentProcedureContents>True</DoNotIndentProcedureContents>
  <ExecuteParametersOnSingleLine>False</ExecuteParametersOnSingleLine>
  <IndentSelectSubclauses>False</IndentSelectSubclauses>
  <UseObjectDefinitionCase>True</UseObjectDefinitionCase>
  <CamelCaseNameOverrides />
  <FormatActionLayout>True</FormatActionLayout>
  <FormatActionApplyCasing>True</FormatActionApplyCasing>
  <FormatActionInsertSemicolons>True</FormatActionInsertSemicolons>
  <FormatActionExpandWildCards>False</FormatActionExpandWildCards>
  <FormatActionQualifyObjectNames>False</FormatActionQualifyObjectNames>
  <FormatActionRemoveSquareBrackets>False</FormatActionRemoveSquareBrackets>
</LayoutOptions>

I have this SQL and need to be formatted.
INSERT INTO sp_dbcc_ind EXECUTE('DBCC IND(''test'', ''test.dbo.t1'', 1)');

Based on my formatter setting, the formatted code is:

INSERT  INTO sp_dbcc_ind
        EXECUTE (
                 'DBCC IND(''test'', ''test.dbo.t1'', 1)'
               );

However, what I want is:
INSERT INTO sp_dbcc_ind
EXECUTE ('DBCC IND(''test'', ''test.dbo.t1'', 1)');

Since my formatting setting is tweaked specifically based on my needs, I do not want to change it. Is it possible to add settings that allow the EXECUTE statement to not indent and its parameter in one line?

Thanks.

Comments

  • Options
    Ali DAli D Posts: 56 New member
    Hi

    Sorry to hear you’re having trouble with the current formatting system. We’re working on a much more powerful formatting system for SQL Prompt and so have halted work on the current formatter. We’re quite close to finishing the new one and it’ll be released in the next beta.

    Once it’s released, it’d be great if you could try it out and let us know whether it solves this issue.

    Thanks
    Ali
  • Options
    ogrishmanogrishman Posts: 81 Bronze 4
    Thank you very much Ali! I can't wait to try the new beta release! :D
Sign In or Register to comment.