Thinking outside the box

Patron Saint of Lost Yaks
posts - 203, comments - 734, trackbacks - 4

My Links

Advertisement

News

Archives

Post Categories

Miscellaneous

New Article series

I have started a new article series at Simple Talk. It's all about the transition from procedural programming to declarative programming. http://www.simple-talk.com/sql/   First article is found here http://www.simple-talk.com/sql/database-administration/the-road-to-professional-database-development-set-based-thinking/   And it is already viewed 5500 times.

posted @ Friday, February 24, 2012 11:39 AM | Feedback (0) | Filed Under [ Miscellaneous ]

Avoid stupid mistakes

Today I had the opportunity to debug a system with a client. I have to confess it took a while to figure out the bug, but here it is SELECT COUNT(*) OfflineData Do you see the bug? Yes, there should be a FROM clause before the table name. Without the from clause, SQL Server treats the name as an alias for the count column. And what do the COUNT always return in this case? It returns 1. So the bug had a severe implication. Now I now it's easy to forget to write a FROM in your query. How can we avoid these stupid mistakes? An...

posted @ Thursday, September 22, 2011 8:38 AM | Feedback (3) | Filed Under [ SQL Server 2008 SQL Server 2005 SQL Server 2000 Miscellaneous Denali ]

Do people want help? I mean, real help?

Or do they just want to continue with their old habits? The reason for this blog post is that I the last week have tried to help people on several forums. Most of them just want to know how to solve their current problem and there is no harm in that. But when I recognize the same poster the very next day with a similar problem I ask myself; Did I really help him or her at all? All I did was probably to help the poster keep...

posted @ Sunday, July 24, 2011 8:08 AM | Feedback (14) | Filed Under [ Miscellaneous Denali ]

MVP renewed

I got an email last friday telling me I was to keep my MVP status! What do one say about that? Except "Thank you". To all that reads my articles and posts. To all who attends my presentations. //Peter

posted @ Sunday, July 03, 2011 3:20 PM | Feedback (0) | Filed Under [ Miscellaneous ]

Feedback from SQLBits 8

This years SQLBits occurred in Brighton. Although I didn’t have the opportunity to attend the full conference, I did a presentation at Saturday. Getting to Brighton was easy. Drove to Copenhagen airport at 0415, flew 0605 and arrived at Gatwick 0735. Then I took the direct train to Brighton and showed up at 0830, just one hour before presenting. This was the easy part. Getting home was much worse. Presentation ended at 1030 and I had to rush to the train station to get back to London, change to tube for Heathrow. Made it at the gate just...

posted @ Wednesday, May 18, 2011 1:25 PM | Feedback (0) | Filed Under [ Miscellaneous ]

A tale from a Stalker

A tale from a Stalker who licked his wounds and got back 9 months later...

posted @ Wednesday, April 27, 2011 4:16 PM | Feedback (5) | Filed Under [ Algorithms Miscellaneous ]

A story from SQLvdb and Idera

A year or so back, I struggled with some consistency problems so I figured out I needed a way to "mount" backup files as a virtual database. At the time (SQL Server 2005 and SQL Server 2008) my choice fell on Idera's SQLvdb because it felt easy enough to use. I used it a few times and it worked great. Some time later we upgraded to SQL Server 2008R2 and I didn't use SQLvbd for a long time. Until yesterday... I was upset that suddenly SQLvbd took more than 2 hours to mount the backup file (if it succeeded at all). I...

posted @ Friday, December 10, 2010 9:33 AM | Feedback (0) | Filed Under [ Miscellaneous ]

Married with children

will happen in just 4 days. The child part is taken care of. Multiple times. Now it's time for the married part. Me and my girlfriend Jennie will be married in Bjuv church at 3pm, Saturday the 28th of August 2010. Pictures of Bjuv church can be found here. After the ceromony we'll goto Hovs Hallar for dinner and party. The famous parts (The chess scenes) of the movie The Seventh Seal by Ingmar Bergman was shot here. We'll sleep there since most of Jennie's family comes from Stockholm (300 miles away). So I'll soon wear a ring on my finger. I tried the "rule them...

posted @ Tuesday, August 24, 2010 12:37 PM | Feedback (3) | Filed Under [ Miscellaneous ]

CHECKSUM weakness explained

The built-in CHECKUM function in SQL Server is built on a series of 4 bit left rotational xor operations. See here in a previous forum post http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=70832 for more explanation. Today, I wanted to see how often a collision (or false positive) can occur. Let's take a very simple CHECKSUM value, for example 123. Decimal 123 is "01111011" in binary representation. Since CHECKSUM function rotates the iterative checksum value 4 bits to the left (same thing as multiplying by 16), how many permutations of two characters returns the same CHECKSUM value of 123? The answer is 16 permutations. Let's investigate by writing down the solution of this...

posted @ Thursday, August 19, 2010 4:15 PM | Feedback (0) | Filed Under [ Algorithms Miscellaneous ]

Ten days left

As some of you know, I was awarded Microsoft Most Valuable Professional (MVP) for SQL Server in July last year. Now it's time to see if I get my MVP renewed, or if I lose the award. I honestly believe it's a good thing MVP status only lasts for one year at a time. Knowledge is fresh. Things that worked in the past may not work any longer due to evolvement, and there are smarter ways to do things now, than before. Being an MVP is a responsibility. It does mean you have more than average knowledge of SQL Server and how...

posted @ Sunday, June 20, 2010 9:21 AM | Feedback (0) | Filed Under [ Miscellaneous ]

Full Miscellaneous Archive

Powered by:
Powered By Subtext Powered By ASP.NET