THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » bad habits   (RSS)
Showing page 1 of 2 (20 total posts)
  • SQL Saturday #262 : Boston

    Today I gave my T-SQL : Bad Habits & Best Practices session at SQL Saturday #262 at Microsoft in Cambridge. Fun event with a lot of friendly faces. A few mishaps along the way:had to wake up at 5:00 AM to take the only sensible commuter rail option to get me there on time;spilled, then proceeded to smear, bagel droppings all over my pants on ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on March 29, 2014
  • SQLBits XI : Bad Habits & Best Practices in T-SQL

    Yesterday I gave my session to the fine folks in Nottingham, UK. Below is a zip file containing the deck and samples:
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on May 4, 2013
  • T-SQL Bad Habits to Kick : NESQL 3/8

    Last Thursday I presented my ''Bad Habits to Kick'' presentation at the New England SQL User Group. Attached is the deck.
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on March 13, 2012
  • Bad Habits to Kick : Believing everything you hear or read

    I read a statement on a forum recently that said something like: IDENTITY columns are the primary key, and primary keys are clustered. Wow. My first thought was, ''I hope people aren't learning from this.'' Unfortunately, I suspect a few already have, as no matter what you write on the Internet or say in passing, at least one person ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on February 27, 2012
  • Bad Habits to Kick : Thinking a WHILE loop isn't a CURSOR

    I see a lot of people suggest while loops instead of cursors in situations where row-based processing is required (or, at least, where folks think that row-based processing is required). Sometimes the justification is that constructing a while loop is simpler and more straightforward than constructing a cursor. Others suggest that a while loop is ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on January 26, 2012
  • Bad Habits to Kick : Using AS instead of = for column aliases

    This one is quite subjective, and I'm sure I will face plenty of opposition - not only because it's a preference thing and many people are married to their preferences, but also because it violates the strict interpretation of the standard. Personally, I'm more worried about the former than the latter - I have no concerns whatsoever that ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on January 23, 2012
  • What do BETWEEN and the devil have in common?

    I'll make no bones about it: BETWEEN is evil. For one, the meaning of the word in English does not always match the meaning of the operator in T-SQL. In T-SQL, BETWEEN is an *inclusive* range - not everyone gets that. Sure, in casual conversation when someone says ''between 3 and 6'' the answer really could be 3, 4, 5 or 6; but other times, they ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 19, 2011
  • Bad Habits to Kick : Using shorthand with date/time operations

    I've come across quite a bit of code that uses date/time shorthand that can either be confusing or downright dangerous. There are two areas I want to focus on: shorthand for date arithmetic, and shorthand for date parts. Date Arithmetic This one I mentioned quite briefly in a previous ''Bad Habits to Kick'' post, but I see it in use enough ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on September 20, 2011
  • Bad Habits to Kick : Using EXEC() instead of sp_executesql

    Today in my T-SQL: Bad Habits to Kick session at SQL Saturday #84 in Kalamazoo, a user asked if SQL Server supported anything like bind variables in Oracle when using dynamic SQL. When using dynamic SQL, you have two choices: EXEC() / EXECUTE(), or sp_executesql. Early on my career, I used EXEC() a lot, because it was much easier. I've since ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on September 17, 2011
  • T-SQL Tuesday #21 : Crap Code

    Yes, Adam is right: we've all written crap code (the topic of this month's T-SQL Tuesday Wednesday. Usually we have an excuse: tight deadline, short shelf life of the code, or didn't know any better. I'm sure if I perused my career codebase I'd find tons and tons of examples that I'd write differently today, because back then it fell under ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on August 10, 2011
1 2 Next >
Privacy Statement