Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » SQL   (RSS)
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 Read More...
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 Read More...
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) Read More...
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 Read More...
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 Read More...
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 Read More...
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 Read More...
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 ). Read More...
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 Read More...
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 Read More...
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 Read More...
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 Read More...
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 Read More...
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 Read More...
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 Read More...
 
Page view tracker