How can we help you today? How can we help you today?

SQL Formatting for Columns to appear on separate lines

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
vjacob1
0

Comments

3 comments

  • Jon_Kirkwood

    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
    0
  • vjacob1
    @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!!!!
    vjacob1
    0
  • Jon_Kirkwood
    Excellent, glad to have been of help and that it was a simple fix for your code formatting
    Jon_Kirkwood
    0

Add comment

Please sign in to leave a comment.