|
|
|
|
Browse by Tags
All Tags » bad habits (RSS)
Showing page 1 of 2 (16 total posts)
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
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 ...
-
T-SQL Tuesday, the invention of Adam Machanic (@AdamMachanic), is what he calls a recurring, revolving blog party. Each month, a new host picks a topic, invites bloggers of all levels to join in, and then after all the submissions are in, writes a summary of all of the entries. This encourages people to participate in the community more ...
-
In Boston today I presented my ''Bad Habits to Kick'' deck to 66 people. You can download the deck and samples from the SQL Saturday web site or directly from http://bit.ly/AB-71-Slides.
Like the Chicago event, folks were encouraged to submit feedback immediately after the session, by picking a random eval and giving the winner a token (in this ...
-
Microsoft is often considered a leader, an innovator, a trend-setter. The same could be said for Apple, Google, and a host of other tech companies. And each of those has its set of critics as well, who think that the company is the opposite - or worse. Some people think it is a good idea to model their own code, architecture or ...
-
In my last post in this series, I talked about problems associated with creating (and using) what I call the ''uber-view.'' This time, in line with tomorrow's T-SQL Tuesday hosted by Mike Walsh, I wanted to talk about some I/O issues that tend to get ignored in a lot of environments.
Introduction
In my experience, today's SQL Server ...
1
|
|
|
|
|