Being Cellfish

Stuff I wished I've found in some blog (and sometimes did)

Browse by Tags

Tagged Content List
  • Blog Post: Using triggers to protect your database from developers - still not a good idea

    A long time ago I mentioned that triggers is rarely a good option in your database. I recently read this article ( requires free registration ) that shows you a solution to prevent developers from updating a full table (or deleting it all) by mistake because they failed to ad a WHERE clause to their...
  • Blog Post: SQL server backup myths

    Any kind of backups other than straight file copies have Always been magic to me. Mostly because in the early years of my career it was so rare that the backups actually worked when needed because nobody evern tried the backups to see if they were actually working... This post ( free registration needed...
  • Blog Post: SQL CLR Aggregates

    I'm still waiting for the day I actually need to write my own aggregate for SQL server in managed code. This article (requires free registration to read) made me better prepared for that day.
  • Blog Post: The cost of a row in SQL Azure

    If you ever want to know how much a row in your SQL Azure database would cost you if you did not pay a fixed price... You want to read this .
  • Blog Post: 7 tips for faster SQL queries (are really just 5)

    I like when people make lists of things and decide on how many things they want in the list before they actually make the list. Usually it means a few items on the list are not so good. And by coincidence I have found another list like that which is related to SQL and I'm seeing a pattern ... Use...
  • Blog Post: Considering future performance in your database

    Ten years ago I worked on a project where we did a lot of fancy things with a number of databases. I learned a lot during that project but I also heard a funny story a coworker told me: I was called in to fix a problem with an accounting system. The customer described the problem as an invalid...
  • Blog Post: Handling different versions of the database

    The only way to handle database changes I've used before was either a number of SQL scripts which usually was a pain since it was almost impossible to remember what version of the database you had so you never knew which of the scripts to run. A better method I've used was to use a migration tool that...
  • Blog Post: How to prevent the use of "SELECT *"

    One good tip for writing good SQL code is to always select the columns you need and never just select everything. Well here is a description on how to actually prevent SELECT * queries (you need to complete a free registration to see the article). The basic idea is to add a dummy column to all your tables...
  • Blog Post: SQL programming mistake #12

    I would like to add another thing to my previous list . And that is the mistake of not properly understanding how to use correctly create the WHERE clause. I came to think about this when I read this which also includes a few good tips on how to rewrite your query to work more efficient.
  • Blog Post: SQL programming mistakes

    I recently read this comprehensive list with ten common mistakes done when writing SQL. And I'd like to add number eleven to that list: using dynamic queries in stored procedures . Especially in projects with a lot of stored procedures for parts (or all) of the business logic there is often a few stored...
  • Blog Post: 20 tips to write a good stored procedure (is really just 12)

    A few days ago there was an article with 20 tips to write a good stored procedure (requires free registration to read). The problem is that there are really only 12 good tips (and 4 bad and 4 neither good or bad). So let me go over the tips one by one and comment on them: Capital letters for keywords...
  • Blog Post: Instead of triggers

    I've never been a big fan of triggers in a database since the existence of triggers is easily overlooked. I've also seen the use of triggers in situations where they where used to fix a bad database design. Specifically trigger were used to enforce constraints on other tables. I've also seen triggers...
  • Blog Post: Random SQL

    I must say that I have never used the random functionality in SQL more than once in my life and that was not for work, it was in a hobby project. Never the less, I find this article (free registration required) on how the RAND function works and is seeded quite interesting. A summary of the article...
  • Blog Post: SQL Unit Testing

    Thought it was time to combine my old favorite subject (SQL) with a new interest (TDD). So how do you test drive your SQL? I think the first answer is you don't . The database is typically something you want to fake anyway since setting up and accessing the database is to slow when you want rapid feedback...
  • Blog Post: Becoming a good programmer takes time

    By now you've hopefully heard about craftsmanship over crap and the other day I heard about a research report where they concluded that university students majoring in engineering have problems translating theory into practice ( article in Swedish ). Education is not the key to becoming a good programmer...
  • Blog Post: Joining with previous and/or next row

    Sometimes in my career I've had to create SQL queries that uses data from the previous and/or next row in the result. That is, something I wont on row X depends on row X -1 or X +1 in the result. Most of the time I have not done this in the SQL query itself but rather in worked on the result but a few...
  • Blog Post: Testdriven Database development

    I recently found this interesting article on TDD when using T-SQL . It describes how a new unit test framework form T-SQL, called tsqlunit , works. Even though it feels like the framework lacks a lot of the fancy asserts and that is probably because of limitations in T-SQL I still welcome it as a new...
  • Blog Post: Be suspicious to DAL frameworks

    I've always been suspicious to SQL queries that are automagically generated by some framework. And when I read this article on lengthy SQL queries it certainly was another gallon of gasoline on the fire. Sure premature optimization is the root of all evil and all that but there is also another important...
  • Blog Post: Readable SQL

    I read this article on SQL Code Layout and Beautification and can only agree with the author that other people's SQL often is hard to understand because I'm so used to how I write my SQL statements. One of the links is to an on-line tool formatting your SQL according to a number of rules. I was happy...
  • Blog Post: SQL crosswords

    I don't know what's worse; making crosswords with only SQL related questions (requires free registration to access) or actually trying to solve the same. This is one of many thing that currently puzzles me. One other thing that also scares me is that I get annoyed when I cannot solve these crosswords...
  • Blog Post: Stored Procedures and data sharing

    In my career I've worked with stored procedures in a way I think many people never do. For example I've worked on projects where both the data access and the business logic have been placed in the database in the form of stored procedures. Not quite your standard three-tier solution but it works quite...
  • Blog Post: UPSERT in SQL server 2008

    I recently read this article on upsert functionality in SQL server 2008 . I thought that the SQL server team finally had come to theri senses and added functionality similar to replace in MySQL , something that have been available in MySQL for ages. But no. The article describes a way to use the new...
Page 1 of 1 (22 items)