Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Code formatting.

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-03-27 : 15:39:39
Last time wasting question today:

I use SQLAssistant and Redgate as addons to SSMS. I don't use them for much other than cleaning up the formatting of the code layout. Sometimes, it does the opposite. One of the things i dislike is with long INSERT INTO statements, it lists the field names vertically. I would prefer to see those field names clustered together in a paragraph sort of style. Is there any way to tweak SSMS to do so?

thanks

james

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-27 : 15:52:03
No..you want the listed vertically AND with leading (not trailing Commas). It's all about drawing they eyes directly to malformed code quickly



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-03-27 : 16:03:52
Brett,

Not sure I follow how having leading commas is beneficial over trailing ones.

--james
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-27 : 16:20:43
Which do you think is easy to "read"


SELECT ThisIsMyColumn1,
Col2,
ArchiveDate,
WWWW,
[END],
[BEGIN]
FROM

SELECT ThisIsMyColumn1
, Col2
, ArchiveDate
, WWWW
, [END]
, [BEGIN]
FROM



I personally think the second one is

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2012-03-27 : 16:24:47
and with leading commas you can comment a line without having trouble...


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2012-03-27 : 16:28:46
Yuch. I like trailing commas.
Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-03-27 : 16:43:29
proponents of leading commas: I see your point.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2012-03-27 : 16:44:21
To each their own

I also prefer Margaritas Rocks no Salt, with very little mix..more like a 12 oz shot of tequila, Cointreau, lime juice and cognac

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx


Want to help yourself?

http://msdn.microsoft.com/en-us/library/ms130214.aspx

http://weblogs.sqlteam.com/brettk/

http://brettkaiser.blogspot.com/


Go to Top of Page
   

- Advertisement -