THE SQL Server Blog Spot on the Web

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

Browse by Tags

All Tags » Best Practices » habits   (RSS)
Showing page 1 of 2 (18 total posts)
  • Bad habits to kick : mis-handling date / range queries

    In my last post in this series, I talked about using user-defined data types (alias types).  Today I wanted to discuss many of the ways in which people subject their date and time columns to very inappropriate query methodologies.  It's very easy to say, ''Hey, don't do the wrong thing!''  Not so easy to actually accomplish, ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 16, 2009
  • Bad habits to kick : using alias types

    In my last post in this series, I talked about using the visual designers in SSMS.  This time, I wanted to treat the use of alias types. To clarify what I am talking about here, alias types used to be called ''user-defined data types.''  Then, when CLR came around in SQL Server 2005, they gave us the ability to create our own CLR ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 14, 2009
  • Bad habits to kick : using the visual designers

    In my last post in this series, I talked about abusing triggers.  This time I thought I would focus a bit on using the visual designers in SSMS.  Table DesignerMy biggest problem with the Table Designer : many changes you make can force SQL Server to rebuild the table.  Obviously this can be a very expensive operation if the table ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 14, 2009
  • Bad habits to kick : abusing triggers

    In my last post in this series, I talked about choosing inappropriate data types.  This time, I want to touch on a few ways that I see triggers being misused.  Using a trigger at all A lot of people think that they need a trigger.  They allow direct access to tables instead of forcing data access through stored procedures, and ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 12, 2009
  • Bad habits to kick : choosing the wrong data type

    In my last post in this series, I talked about the assumptions many people make about IDENTITY columns.  In this post, I want to focus on choosing data types.  There are several areas where I see frequent mistakes in data type choice, and I'll mention a few here. Using CHAR / VARCHAR / INT for date / time values Countless times I have ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 12, 2009
  • Bad habits to kick : making assumptions about IDENTITY

    In my last post in this series, I talked about inconsistent naming conventions.  This time I want to talk about a few of the assumptions people make when using IDENTITY columns, and what kind of trouble they can cause. IDENTITY will prevent gaps A lot of people choose IDENTITY as their ''primary key'' and expect it to leave no gaps - ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 11, 2009
  • Bad habits to kick : inconsistent naming conventions

    In my last post in this series, I talked about using the schema prefix, with particular focus on dbo-only systems.  In this post, I want to treat the use of inconsistent naming conventions. Stored ProceduresIn one of the systems I've inherited, we have stored procedures written by different people (or even by the same people at different ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 11, 2009
  • Bad habits to kick : avoiding the schema prefix

    In my last post in this series, I treated the dreadful SELECT * and other ways we get around typing out a column list.  This time I want to discuss the use of the schema prefix. This has to do with both creating and referencing objects.  Do not make any assumptions about which schema an object belongs to.  All your objects belong ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 11, 2009
  • Bad Habits to Kick: Inconsistent Indentation

    My last post in Aaron's series drew a mixed review from some readers, and I'm sure this one will do the same. But that's part of the fun! One of the biggest threats to maintainability is code that's not properly formatted. When I'm called in by a customer to debug some legacy code, often the first thing I'll have to do is re-format the code so ...
    Posted to Adam Machanic (Weblog) by Adam Machanic on October 10, 2009
  • Bad habits to kick : using SELECT * / omitting the column list

    In my last post in this series, I talked about inappropriately using SELECT, OUTPUT and RETURN in stored procedures.  Today I wanted to talk about using SELECT * or omitting the column list entirely. Using SELECT * This is a typical operation when developing, debugging or testing, and I have no qualms about its use there.  But ...
    Posted to Aaron Bertrand (Weblog) by AaronBertrand on October 10, 2009
1 2 Next >
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement