November 8, 2017 at 10:11 am
Grant Fritchey - Wednesday, November 8, 2017 5:33 AMRight there with you. We'll have to remove Sean from the island...
wow... glad I'm a comma at the end of line person, tough crowd here!
November 8, 2017 at 10:21 am
Brandie Tarvin - Wednesday, November 8, 2017 8:54 AMI'm a speed reader. The way I read items, things have to be bunched together in order for me to comprehend and consume properly. If columns are each on their own line, it messes with my head and I spend twice as much time (or more) trying to understand the code.I put CASE statements on their own line. IF clauses on their own line. Long expressions on their own line (or indented down several lines). But a majority if regular columns are one right after another on the same line until I get about an inch away from the right side of the screen. Also, the Alias = Column thing I'd never seen until last year and it threw me for a loop. I use Column AS Alias. It's a standard here that column aliases *must* use the AS keyword so we know the person writing the code didn't accidentally forget a comma between two column names. Which actually has happened more often then you might think.
It's been a while since I worked on my speed reading, but can't you just scan the column of values? Or if that doesn't work, invert the screen and drag your finger over it? </snark>
-------------------------------------------------------------------------------------------------------------------------------------
Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses
November 8, 2017 at 10:25 am
jasona.work - Tuesday, November 7, 2017 1:28 PMI...
I'm speechless...
Joe C has a sense of humor about his forum persona: https://www.sqlservercentral.com/Forums/FindPost1906603.aspx
:blink:I know some of you have said that in person he's a nice guy, but after seeing some of his postings here it's almost a surprise to really *see* that.
Holy crackers, and Jeff absolutely annihilated his suggestion with that opinion right after. Jeez, quite a comparison there.
-------------------------------------------------------------------------------------------------------------------------------------
Please follow Best Practices For Posting On Forums to receive quicker and higher quality responses
November 8, 2017 at 12:29 pm
Brandie Tarvin - Wednesday, November 8, 2017 5:24 AMYou realize, of course, that we can no longer be friends now, right? :hehe:
Guess that includes me. I like commas at the front. And code isn't prose.
November 8, 2017 at 12:32 pm
Steve Jones - SSC Editor - Wednesday, November 8, 2017 12:29 PMBrandie Tarvin - Wednesday, November 8, 2017 5:24 AMYou realize, of course, that we can no longer be friends now, right? :hehe:Guess that includes me. I like commas at the front. And code isn't prose.
We through Steve off the island a long time ago. It explains the shirts.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 9, 2017 at 4:17 am
jonathan.crawford - Wednesday, November 8, 2017 10:25 AMjasona.work - Tuesday, November 7, 2017 1:28 PMI...
I'm speechless...
Joe C has a sense of humor about his forum persona: https://www.sqlservercentral.com/Forums/FindPost1906603.aspx
:blink:I know some of you have said that in person he's a nice guy, but after seeing some of his postings here it's almost a surprise to really *see* that.
Holy crackers, and Jeff absolutely annihilated his suggestion with that opinion right after. Jeez, quite a comparison there.
JC's justification for ripping unsuspecting folks a new ring merely confirms what many folks already suspected - that the guy thinks he's something else. It might have been amusing but it fell short. I don't care how many books he's written or committees he's sat on, it's plain wrong, it's abusing what should be a privilege, and I side with Jeff and his comment.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
November 9, 2017 at 4:50 am
Grant Fritchey - Wednesday, November 8, 2017 12:32 PMSteve Jones - SSC Editor - Wednesday, November 8, 2017 12:29 PMBrandie Tarvin - Wednesday, November 8, 2017 5:24 AMYou realize, of course, that we can no longer be friends now, right? :hehe:Guess that includes me. I like commas at the front. And code isn't prose.
We through Steve off the island a long time ago. It explains the shirts.
Going through Steve to get him off the island must've been messy...
November 9, 2017 at 6:02 am
jasona.work - Thursday, November 9, 2017 4:50 AMGrant Fritchey - Wednesday, November 8, 2017 12:32 PMSteve Jones - SSC Editor - Wednesday, November 8, 2017 12:29 PMBrandie Tarvin - Wednesday, November 8, 2017 5:24 AMYou realize, of course, that we can no longer be friends now, right? :hehe:Guess that includes me. I like commas at the front. And code isn't prose.
We through Steve off the island a long time ago. It explains the shirts.
Going through Steve to get him off the island must've been messy...
Forgive us our typos as we forgive those who typo against us.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
November 9, 2017 at 6:13 am
Grant Fritchey - Thursday, November 9, 2017 6:02 AMForgive us our typos as we forgive those who typo against us.
That was not a typo! π
Typo: an error in printed or typewritten matter resulting from striking the improper key of a keyboard, from mechanical failure, or the like.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
November 9, 2017 at 6:14 am
Lynn Pettis - Wednesday, November 8, 2017 9:15 AMBrandie Tarvin - Wednesday, November 8, 2017 8:54 AMI'm a speed reader. The way I read items, things have to be bunched together in order for me to comprehend and consume properly. If columns are each on their own line, it messes with my head and I spend twice as much time (or more) trying to understand the code.I put CASE statements on their own line. IF clauses on their own line. Long expressions on their own line (or indented down several lines). But a majority if regular columns are one right after another on the same line until I get about an inch away from the right side of the screen. Also, the Alias = Column thing I'd never seen until last year and it threw me for a loop. I use Column AS Alias. It's a standard here that column aliases *must* use the AS keyword so we know the person writing the code didn't accidentally forget a comma between two column names. Which actually has happened more often then you might think.
This is where something like SQL Prompt is nice. Configure how you want things and use Ctrl-K,Ctrl-Y to format the code the way you like. When you send it to someone else, they can do the same thing to put it in a format that is easier for them.
Me, one column per line. I have moved to the leading comma, but mostly because I have been finding myself commenting columns toward the end of the select list rather than at the beginning. I still refuse to accept the ; as a beginninator. That will always belong at the end of a statement.
I cannot stop doing:
CASE WHEN [Label] = 'Something' THEN 'Shopping'
WHEN [Label] = 'Another'
AND [Label] = 'This Too' THEN 'Browsing'
WHEN [Label] = 'One More' THEN 'Leaving'
CASE unless it's on the same line and tabbed out to square it off where it makes sense. Breaking it out per new line ends up being this multi-line read to figure out if this column = 'This' THEN do 'This'. Feels like a winding staircase. But, that's the C++ in me trying to tab and create a block of neat code rather than trying to spread a CASE statement out over 100 lines. π
November 9, 2017 at 6:20 am
xsevensinzx - Thursday, November 9, 2017 6:14 AMI cannot stop doing:
CASE WHEN [Label] = 'Something' THEN 'Shopping'
WHEN [Label] = 'Another' AND [Label] = 'This Too' THEN 'Browsing'
WHEN [Label] = 'One More' THEN 'Leaving'
Fixed it for you. @=)
November 9, 2017 at 6:29 am
Brandie Tarvin - Thursday, November 9, 2017 6:20 AMxsevensinzx - Thursday, November 9, 2017 6:14 AMI cannot stop doing:
CASE WHEN [Label] = 'Something' THEN 'Shopping'
WHEN [Label] = 'Another' AND [Label] = 'This Too' THEN 'Browsing'
WHEN [Label] = 'One More' THEN 'Leaving'Fixed it for you. @=)
I like that way too! But, started breaking AND OR's etc to it's new line just because it forces such a long force of everything else to fit!
November 9, 2017 at 10:35 am
Sigh...
Work from home only works when the work VPN is working...
Bloody thing went down at 10:20 this morning and still isn't back up. Able to do other things that are work-related and haven't had anything come up to where I need to actually put on pants to go in (yet.)
November 9, 2017 at 11:43 am
jasona.work - Thursday, November 9, 2017 10:35 AMSigh...
Work from home only works when the work VPN is working...
Bloody thing went down at 10:20 this morning and still isn't back up. Able to do other things that are work-related and haven't had anything come up to where I need to actually put on pants to go in (yet.)
I have permission to work from home, just not doing it yet since dad is still in the hospital.
November 9, 2017 at 11:58 am
Lynn Pettis - Thursday, November 9, 2017 11:43 AMjasona.work - Thursday, November 9, 2017 10:35 AMSigh...
Work from home only works when the work VPN is working...
Bloody thing went down at 10:20 this morning and still isn't back up. Able to do other things that are work-related and haven't had anything come up to where I need to actually put on pants to go in (yet.)I have permission to work from home, just not doing it yet since dad is still in the hospital.
How's he doing now?
Viewing 15 posts - 60,331 through 60,345 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply