Format INSERT INTO...EXECUTE
ogrishman
Posts: 81 Bronze 4
This is my format settings (you can import into SQL Prompt):
I have this SQL and need to be formatted.
Based on my formatter setting, the formatted code is:
However, what I want is:
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.
<?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
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