Mladen Prajdić Blog

Blog about stuff and things and stuff. Mostly about SQL server and .Net

SQL Server 2005: Split string XML Style

Here's a Split function using XML datatype. It's preety neat and simple compared to all others that i've seen. Forget While Loops and recursive CTE's. Enter XML:  IF OBJECT_ID('dbo.Split') IS NOT NULL DROP FUNCTION dbo. Read more →

SQL Server 2005: How to have a Unique Constraint with multiple NULLS on a column

Ever wanted to have have a table that contains unique values but needs to have multiple null values also? Here's how to do it: SET NUMERIC_ROUNDABORT OFF; SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS ON; GO CREATE TABLE t1 (id INT, title VARCHAR(20)) GO – optional instead of trigger to disable the insert directly into the table CREATE TRIGGER trg_t1_DisableInsert ON t1 INSTEAD OF INSERT AS BEGIN – use 18 to stop further processing RAISERROR (40000, 18, 1, 'Use view dbo. Read more →

Book Review: Inside SQL Server 2005: T-SQL QUERYING

This is an AWSOME book! Written by Itzik Ben-Gan and coauthored by Lubor Kolar and Dejan Sarka it's definitly worth it's money. It starts with the chapter on logical query processing in which it explaines the basics of the full select statement and the order of processing it. Read more →

Multiple Active Result Sets

I've written an article about Multiple Active Result Sets (MARS) and it's published on SQLTeam.com Multiple Active Result Sets is a new SQL Server 2005 feature that, putting it simply, allows the user to run more than one SQL batch on an open connection at the same time. Read more →

Why is MVP Summit under NDA?

We had an interesting discussion here about Katmai (the next SQL Server version) Of course it was discussed in the latest MVP summit, but noone can say anything because it's all under NDA. Read more →

How to store an incomplete date?

When doing apps that deals with date there almost always comes a question on how to store an incomplete date. For example:  Person A is born on 1980-02-17. Person B is born on 1980-02 <- The person doesn't know the exact day (This is acctually a real life scenario) Read more →