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

Tab Spacing within SQL code tags Expand / Collapse
Author
Message
Posted Tuesday, September 13, 2011 2:12 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 1:02 AM
Points: 227, Visits: 666
Hi,

Is it possible to sort out the tab spacing when posting code with [code=sql][/code] tags? When you go to the trouble of laying out your code properly to make it readable, it is a bit irritating to see it mangled to death on display!

Thanks, Iain
Post #1173945
Posted Tuesday, September 13, 2011 2:34 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, October 9, 2013 5:08 AM
Points: 1,123, Visits: 603
I've seen the same issue when on using sql scripts on different machines. Tab settings often differ locally and that's why I would rather use spaces instead of tabs. I never liked using tabs across local machines and websites, but trouble is that so many tools use tabs.

You can easily replace a tab with a certain amount of spaces with Find and Replace in SSMS at least.


Ronald Hensbergen

Help us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/
-------------------------------------------------------------------------
2+2=5 for significant large values of 2
Post #1173954
Posted Tuesday, September 13, 2011 7:40 AM


SSC-Dedicated

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

Group: Administrators
Last Login: 2 days ago @ 3:11 PM
Points: 31,368, Visits: 15,837
Don't use tabs. No one can count on consistent tabs spaces, so if you expect 3 or 4 spaces, and it's different, the code is mangled.

You should always set editors to insert spaces instead of tabs when pressing the tab key and that should fix the issue.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1174149
Posted Tuesday, September 13, 2011 8:02 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, April 22, 2014 1:02 AM
Points: 227, Visits: 666
Well you learn something new every day

Text editor changed, thanks for the tip.
Post #1174187
Posted Tuesday, September 13, 2011 8:36 AM


SSC-Dedicated

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

Group: Administrators
Last Login: 2 days ago @ 3:11 PM
Points: 31,368, Visits: 15,837
You are welcome. As soon as I started working in environments with other DBAs / developers, we made that switch since code would be formatted differently on different machines.






Follow me on Twitter: @way0utwest

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

Add to briefcase

Permissions Expand / Collapse