SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Old Dog, New Tricks


Old Dog, New Tricks

Author
Message
Steve Jones
Steve Jones
SSC Guru
SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)SSC Guru (63K reputation)

Group: Administrators
Points: 63809 Visits: 19116
Comments posted to this topic are about the item Old Dog, New Tricks

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
davoscollective
davoscollective
SSC Eights!
SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)SSC Eights! (939 reputation)

Group: General Forum Members
Points: 939 Visits: 1004
You can teach an old dog new tricks! Mythbusters proved that one Smile

Coming from an Oracle background, I always use semi-colons, but strangely SSRS (using BIDS 2008) removes them automatically when you use them (in the rare event that I don't used a stored proc)

If you use Openquery from SQL Server to Oracle with the OraOLEDB.Oracle provider it returns an error "invalid character" if you use a semicolon in the passed-through query.

It might be ANSI but it's not consistently applied.
IceDread
IceDread
Mr or Mrs. 500
Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)

Group: General Forum Members
Points: 527 Visits: 1145
Fun topic.

About alias, I do not agree. I think "as" is the way to go. It's standard and everyone understands it and you don't risk confusion, it also does not take any more time to write "as" than "=", if anything "as" goes faster.

About aging, it's been proven recently that people over 45 solves equations a bit more slowly than younger ones.

With that said, I feel some people now must raise their voices to redeem themselves and point to that experience and knowledge holds a high value as well and I do of course agree.
Also, it's common that engineers has an iq around 125, thus giving an advantage still over the general population, not that it matters except you have the ability to claim a more interesting job and complete it.

Then about learning new things, I do not think that has to do with age. I firmly believe some people are more interested and might also be better at grasping new concepts than others. It might just stand out more when someone who is old is not interested to learn. Then there is one more thing I'd like to point out, science has proven that our brain actually hurts a little when we learn new things and this might be a cause for pointing us towards old habits. Then of course some people are just plane lazy.
Gary Varga
Gary Varga
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16649 Visits: 6534
I am a developer and am here to improve my knowledge of SQL Server especially my T-SQL

As a bit of a pedant when it comes to coding, I read the article and initially thought that I had learnt nothing. I currently use AS due to its explicit declaration of my intention (as covered by the article), however, as I know that even halfway decent articles always have a point, whether you agree with it or not, and the author said that he favoured = over AS I reread it.

It was when I looked at the side-by-side stored procedures example that it became clear. Literally!!!

I shall be using the = syntax moving forward. My reasoning? The intention is clearer to the reader. Not only of the alias but of the structure being returned. Removing ambiguity from code is the key to delivering a maintainable system.

As for standards? Well, SQL standards should be looking at issues and opportunities such as this but lets not hold our collective breath as it is a necessarily a slow process. Also I have yet to see a RDBMS migration project where they don't treat existing SQL statements as specifications for a rewrite. Anyone compared the various XML syntax?

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
vmit02
vmit02
Mr or Mrs. 500
Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)Mr or Mrs. 500 (570 reputation)

Group: General Forum Members
Points: 570 Visits: 81
Actually SQL Server is being changed iteratively, it is not evolving. It is being directed to a goal by intelligence.
IceDread
IceDread
Mr or Mrs. 500
Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)Mr or Mrs. 500 (527 reputation)

Group: General Forum Members
Points: 527 Visits: 1145
vmit02 (2/2/2012)
Actually SQL Server is being changed iteratively, it is not evolving. It is being directed to a goal by intelligence.


That also falls under the category of evolving.
Gary Varga
Gary Varga
SSCoach
SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)SSCoach (16K reputation)

Group: General Forum Members
Points: 16649 Visits: 6534
Sheesh...and I thought I was a pedant. Really guys, is this not straying off topic? ;-)

Gaz

-- Stop your grinnin' and drop your linen...they're everywhere!!!
paul s-306273
paul s-306273
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2450 Visits: 1116
I've used the SELECT 1 x; format for years. (Oracle background).

I've never found it confusing - I don't now discard that format just because somebody else finds it confusing.

Matter of taste really.
ConnieOI
ConnieOI
SSC Journeyman
SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)SSC Journeyman (82 reputation)

Group: General Forum Members
Points: 82 Visits: 668
I've used the = syntax for many years because it's so much easier for me to read. When there's a long case statement and I'm looking at someone else's T-SQL, I feel that it wastes my time if I have to sift through the lines to find out what the column name is.

BTW, I switched to using the JOIN ... ON syntax a few years ago, as well, for readability reasons.
cengland0
cengland0
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1690 Visits: 1300
IceDread (2/2/2012)

About aging, it's been proven recently that people over 45 solves equations a bit more slowly than younger ones.

Really? I'd like to see that documentation. I'm over 45 and believe I solve problems and equations much faster than my younger peers. That's because I have more experience doing it. Maybe once they are my age, they can do it faster too.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search