Quantcast
Channel: Thinking outside the box
Browsing latest articles
Browse All 11 View Live

Image may be NSFW.
Clik here to view.

A glance at SQL Server Denali CTP3 - DATEFROMPARTS

There is a new function in SQL Server Denali named DATEFROMPART. What is does, is to calculate a date from a number of user supplied parameters such as Year, Month and Date. Previously you had to use a...

View Article



Image may be NSFW.
Clik here to view.

Code Audit - The Beginning

For the next few months, I will be involved in an interesting project for a mission critical application that our company have outsourced to a well-known and respected consulting company here Sweden....

View Article

Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

Convert UTF-8 string to ANSI

CREATEFUNCTION dbo.fnConvertUtf8Ansi(    @Source VARCHAR(MAX) )RETURNSVARCHAR(MAX)AS BEGIN    DECLARE @Value SMALLINT = 160,            @Utf8 CHAR(2),            @Ansi CHAR(1)    IF @Source NOTLIKE...

View Article

Image may be NSFW.
Clik here to view.

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 isSELECTCOUNT(*) OfflineData Do you see the bug? Yes, there should be a...

View Article


Image may be NSFW.
Clik here to view.

How to calculate the covariance in T-SQL

DECLARE @Sample TABLE        (            x INTNOTNULL,            y INTNOTNULL        )INSERT  @SampleVALUES  (3, 9),        (2, 7),        (4, 12),        (5, 15),        (6, 17);WITH cteSource(x,...

View Article

Image may be NSFW.
Clik here to view.

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...

View Article

Image may be NSFW.
Clik here to view.

The one feature that would make me invest in SSIS 2012

This week I was invited my Microsoft to give two presentations in Slovenia. My presentations went well and I had good energy and the audience was interacting with me.When I had some time over from...

View Article


Image may be NSFW.
Clik here to view.

Remove all Extended Properties in a database

During my tests to port several databases to SQL Azure, one of the recurring things that fails export is the Extended Properties. So I just wanted to remove them. This is a simple wayh to list all...

View Article


Image may be NSFW.
Clik here to view.

ISO week calculation for all years 1-9999 without dependencies

CREATE FUNCTION dbo.fnISOWEEK ( @Year SMALLINT, @Month TINYINT, @Day TINYINT ) RETURNS TINYINT AS BEGIN RETURN ( SELECT CASE WHEN nextYearStart <= theDate THEN 0 WHEN currYearStart <= theDate...

View Article
Browsing latest articles
Browse All 11 View Live




Latest Images