SQL Formatting for Columns to appear on separate lines

vjacob1vjacob1 Posts: 57 Bronze 1
My SQL Prompt is showing all the columns on one line when I expand from SELECT *
What is the formatting option so that the columns appear on separate lines and also the columns have the alias in them
Tagged:

Best Answer

  • Jon_KirkwoodJon_Kirkwood Posts: 436 Gold 1

    Hi @vjacob1

     

    Thank you for reaching out on the Redgate forums regarding your SQL Prompt question.

     

    I believe there are a couple of settings you may want to set to get this working.

     

    When you are editing your style (SQL Prompt > Active Styles > Edit Active Style)

    In the Global > Lists menu there are two options for List items

    • Place first item on new line
    • Place subsequent items on new lines

    Enabling these settings should put your columns on separate lines when expanding the wild card

     

     

    Then in the SQL Prompts options (SQL Prompt > Options > Inserted Code > Aliases

    Enable Assign Aliases

    This will enable aliases when you enter tables/objects and also when you format code.

     


    This should then turn the statement below into a formatted and expanded block of code

     Is this the type of functionality you are trying to achieve?

    Jon Kirkwood | Technical Support Engineer | Redgate Software

Answers

  • vjacob1vjacob1 Posts: 57 Bronze 1
    @Jon_Kirkwood
    Yes that is exactly what I was trying to do.
    I just noticed that sometimes it was putting all columns on the same line - I am not sure if it was my settings but I reset everything and went back in and now it is doing the right behavior.
    I thought there was some other formatting tweaks that I would need to add.

    Thanks!!!!
  • Excellent, glad to have been of help and that it was a simple fix for your code formatting
    Jon Kirkwood | Technical Support Engineer | Redgate Software
Sign In or Register to comment.