Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««12345

Tabs or Spaces Expand / Collapse
Author
Message
Posted Tuesday, March 20, 2012 6:31 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Monday, December 02, 2013 6:30 AM
Points: 346, Visits: 691
Rose Bud (3/19/2012)
Can anyone recommend a free or very inexpensive SQL Beautifier/Formatter which works well with complex queries? One that integrated with SSMS 2008 would be ideal.


I *love* SQL Prompt from RedGate, it's not terribly expensive and the Format SQL command has a two-keystroke shortcut (^K^Y). Does a bunch of other stuff too like enhancing intellisense. And it integrates into SSMS.
Post #1269490
Posted Tuesday, March 20, 2012 10:22 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Today @ 5:00 AM
Points: 551, Visits: 3,155
i prefer tabs to spaces.
main reason is probably because i can highlight multiple rows and tab them across where as if i did that with the spacebar it would delete the rows.
also because i think its easier to align rows with tabs.
Post #1269710
Posted Tuesday, March 20, 2012 10:43 AM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Tuesday, April 01, 2014 6:18 PM
Points: 117, Visits: 546
davidandrews13 (3/20/2012)
i prefer tabs to spaces.
main reason is probably because i can highlight multiple rows and tab them across where as if i did that with the spacebar it would delete the rows.
also because i think its easier to align rows with tabs.
In SSMS, highlight those rows and hit tab to move across or shift+tab to move left... I use spaces all the time and have zero deletions.
Post #1269724
Posted Tuesday, March 20, 2012 2:32 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, March 28, 2014 11:27 AM
Points: 494, Visits: 1,120
Heh, anyone else agree that anything produced by the Query Designer is visually heinous?

Looking for a Deadlock Victim Support Group..
Post #1269859
Posted Tuesday, March 20, 2012 3:06 PM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Friday, November 22, 2013 11:05 AM
Points: 3,108, Visits: 2,116
This was entertaining - kind of like 'The Crusades' in the middle ages ...



Regards
Rudy Komacsar
Senior Database Administrator

"Ave Caesar! - Morituri te salutamus."
Post #1269877
Posted Wednesday, July 03, 2013 11:26 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 06, 2014 1:22 PM
Points: 54, Visits: 414
We share a peeve.
Post #1470174
Posted Wednesday, July 03, 2013 11:51 AM


Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, March 06, 2014 1:22 PM
Points: 54, Visits: 414
Death to char(9) in SQL code:
1. Indented code characters will move one space, more than one space (depending on what user preference was) or not at all when inserting/deleting empty “space” in front of a line of SQL code when tabs are used along with spaces. One of those three things happens, and we cannot know which, if there are a combination of spaces and tabs to the left of SQL code when removing or adding to indention. Using tabs along with spaces violates the principle of least surprise.
2. Fact is we will present scripts in any number of tools where we can present text. Does anyone expect otherwise? We all should care about every text presentation tool we might routinely use, including Email, IM, Word Processors, Spreadsheets, et.al. No telling where a script might need including, and including them should be as simple as possible. While that last bit is an opinion, I like to think it so obvious it stands on its own merit.
3. It is a fact that not knowing whether a preceding character is a tab or a space makes using find and replace harder. For instance, replacing all space-comma-space with space-space-comma-space will miss all tab-comma-space. Or can some of you visually distinguish tabs in the editor?
4. The space bar is large; it is conveniently located (under either thumb); it is easy to strike multiple times rapidly. These are ergonomic facts and they are obviously less true for the tab key, which is much smaller, under-left-pinkie and more difficult to push even for a touch typist.
5. Disallowing an additional unseen character means we never have to code to allow for it while searching through or automatically formatting the text of our library of views, stored procedures or functions. This is a fact.
6. Overall, editing and re-editing code with tabs will take longer because of reasons stated in 1-5 above.

Fortunately we can use the tab key to insert spaces instead!
Post #1470182
Posted Wednesday, July 03, 2013 2:29 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 8:20 PM
Points: 32,764, Visits: 14,928
I'd argue these days we should have tools that reformat stuff for us. My company (Red Gate) makes one, but there are others.

We shouldn't have to worry about this stuff.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1470232
Posted Wednesday, July 03, 2013 2:40 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 5:41 PM
Points: 35,944, Visits: 30,229
Steve Jones - SSC Editor (7/3/2013)
I'd argue these days we should have tools that reformat stuff for us. My company (Red Gate) makes one, but there are others.

We shouldn't have to worry about this stuff.


Unfortunately and even with many options, none of them format code like I want it.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1470234
Posted Wednesday, July 03, 2013 2:52 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Yesterday @ 8:20 PM
Points: 32,764, Visits: 14,928
Jeff Moden (7/3/2013)
Steve Jones - SSC Editor (7/3/2013)
I'd argue these days we should have tools that reformat stuff for us. My company (Red Gate) makes one, but there are others.

We shouldn't have to worry about this stuff.


Unfortunately and even with many options, none of them format code like I want it.


I understand. I have a few requests into the Prompt team to allow a few more options.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1470238
« Prev Topic | Next Topic »

Add to briefcase «««12345

Permissions Expand / Collapse