When typing in an T-SQL statement, a SELECT for example, after I press the <enter> key, the cursor is indented by 4 characters from the previous line. Like this:
Code: Select all
SELECT *
|<--- insertion cursor is here
I'd prefer not to indent after pressing <enter>. The formatting I use is like this:
Code: Select all
SELECT u.*
FROM dbo.Users AS u
WHERE u.UserID = @UserID;
My typing stream is 'SELECT <tab> u.* <enter> FROM <tab> dbo.Users AS u <enter> WHERE <tab> u.UserID = @UserID; <enter>". I like the extensive formatting options that Studio has. I've made my own profile (copied from default) and have modified that for my coding style. I primarily use it when refactoring code that is a horrible mess. For new code, it is working against me or perhaps I am working against the feature. I cannot find where to turn off the auto-indent after newline. With the amount of options available, I'm sure it's in there.
Perhaps I am using auto-format incorrectly and need a correction in my habits. I don't discount that either.