Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 258049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:08:53+00:00 2026-05-11T22:08:53+00:00

None of my SQL Server stored procedure editing IDEs seem to have any tools

  • 0

None of my SQL Server stored procedure editing IDEs seem to have any tools to enforce indentation styles, so I find that a lot of the stored procedures I see are all over the place. I find indenting really improves readability though. I would like to codify some stored procedure indenting standards in our company’s coding style guide, and I’m wondering if anyone has any best practices they would like to share.

For instance, in a normal SELECT statement, I try to keep the SELECT, FROM, WHERE, ORDER BY, and GROUP BY clauses all on the same level, and indent anything below that. I also try to indent each JOIN one level from the table it’s logically joining into.

Does anyone else have similar advice or best practices?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:08:53+00:00Added an answer on May 11, 2026 at 10:08 pm
    SELECT      T1.Field1,
                T1.Field2,
                T2.Field1 As Field 3
    FROM        Table1 AS T1
    LEFT JOIN   Table2 AS T2
    ON          T1.Field1 = T2.Field7
    WHERE       T1.Field9 = 5
    AND         T2.Field1 < 900
    ORDER BY    T2.Field1 DESC
    
    INSERT INTO Table1 (
                Field1,
                Filed2,
                Field3 )
    VALUES (    'Field1',
                'Field2',
                'Field3' )
    
    UPDATE      Table1
    SET         Field1      = SomeValue,
                Field2      = AnotherValue,
                FIeld134567 = A ThirdValue
    WHERE       Field9      = A Final Value
    

    I find that I dont necessarily has a set indentation length and instead I try to indent based on the length of the field names and values. I like my left margins to line up along any given vertical plane and I like my Evaluators (such as equal signs) to line up. I always have any command term on a different vertical plane than its accompanying values and fields. I also tend to try to make the space between my SELECT command and the Field list equal in length to the space used by a SELECT DISTINCT Field or INSERT INTO Table.

    But in the end, all that is just my preferences. I like neat looking code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What happens when you link to copy(T[]) instead of copy(Object[])?… May 12, 2026 at 1:00 am
  • Editorial Team
    Editorial Team added an answer Your best bet is to use an operating system primitive… May 12, 2026 at 1:00 am
  • Editorial Team
    Editorial Team added an answer The idea of an interface is to represent a contract,… May 12, 2026 at 1:00 am

Related Questions

I'm trying to write a stored procedure that will return two calculated values for
I had a parametrized insert statement that was working well and I needed to
I have a completed web app in PHP 5 + MySQL. I have not
I'm using SQL Server 2005 with Reporting Services. I have many reports installed, some

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.