I want some Moore

Blog about stuff and things and stuff. Mostly about SQL server and .Net
posts - 218, comments - 2281, trackbacks - 33

My Links

Advertisement

News

Hi! My name is 
Mladen Prajdić  I'm from Slovenia and I'm currently working as a .Net (C#) and SQL Server developer.

I also speak at local user group meetings and conferences like SQLBits and NT Conference
Welcome to my blog.
SQL Server MVP

My Books

SQL Server MVP Deep Dives 2
The Red Gate Guide to SQL Server Team based Development Free e-book

My Blog Feed via Email
Follow MladenPrajdic on Twitter


Users Online: who's online

Article Categories

Archives

Post Categories

Cool software

Other Blogs

Other stuff

SQL stuff

May 2007 Blog Posts

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

This book is a sequel to T-SQL Querying. And it stands completly side by side it. I can only recommend that you get it. The amount of new stuff to learn is amazing. So lets see what each chapter covers:   Chapter 1: DataType Related problems, XML and CLR UDTs      Talks about DateTime problems, patterns matching , conversions, large objects, CLR and of course XML which is the biggest part of the chapter. Chapter 2: Temporary tables and Table variables      A great explanation of how, why and what in the world of Temp. Chapter 3: Cursors      Shows that although dreaded by many, they have their rightfull...

posted @ Friday, May 25, 2007 10:03 PM | Feedback (5) | Filed Under [ SQL Server Reviews ]

Weird C# compile possibility

Now this is something i really didn't think it would compile in C#.   private int _someVar = 0; private void DoStuff1() { int _someVar = 0; _someVar = 6; // ... code that uses _someVar } private void DoStuff2() { _someVar = 5; // ... code that uses _someVar }   We should at least get a warning if you ask me...  One learns something new every day.

posted @ Wednesday, May 23, 2007 9:52 PM | Feedback (11) | Filed Under [ .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.Split GO CREATE FUNCTION dbo.Split(@data NVARCHAR(MAX), @delimiter NVARCHAR(5)) RETURNS @t TABLE (data NVARCHAR(max)) AS BEGIN DECLARE @textXML XML; SELECT @textXML = CAST('<d>' + REPLACE(@data, @delimiter, '</d><d>') + '</d>' AS XML); INSERT INTO @t(data) SELECT T.split.value('.', 'nvarchar(max)') AS data FROM @textXML.nodes('/d') T(split) ...

posted @ Tuesday, May 22, 2007 7:23 PM | Feedback (5) | Filed Under [ SQL Server ]

SQL Server: JOIN vs IN vs EXISTS - the logical difference

There is a common misconception that IN behaves equaliy to EXISTS or JOIN in terms of returned results. This is simply not true. To see why not, let's review what each statement does.

More here

posted @ Friday, May 18, 2007 6:52 PM | Feedback (48) | Filed Under [ SQL Server ]

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.v1 to insert data into table') END GO CREATE VIEW v1 WITH SCHEMABINDING AS SELECT id, title FROM dbo.t1 ...

posted @ Thursday, May 17, 2007 12:27 PM | Feedback (19) | Filed Under [ SQL Server ]

Biggest difference between Temp tables and Table variables in Sql Server

We've all heard about differences between temporary tables and table variables in SQL Server. They include performance, storage in memory or disk, tempdb use, etc.   But the biggest and mostly overlooked difference is: Table variables are Transaction neutral. They are variables and thus aren't bound to a transaction. Temp tables behave same as normal tables and are bound by transactions.   A simple example shows this difference quite nicely:   BEGIN TRAN declare @var table (id int, data varchar(20) ) create table #temp (id int, data varchar(20) ) insert into @var select 1, 'data 1' union all select 2, 'data 2' union all select 3, 'data 3' insert into #temp select 1, 'data 1' union all select 2,...

posted @ Sunday, May 13, 2007 5:11 PM | Feedback (23) | Filed Under [ SQL Server ]

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. Just basic stuff. Chapter 2 covers the phyisical query processing. Explaines what parsing, algebratization and executions plans are and how it's all tied together. Chapter 3 covers the query tuning methodology and tools to use for it. In my opinion This chapter is one of the best in the book. Chapter 4 introduces us to subqueries, CTE's and Rank...

posted @ Friday, May 11, 2007 11:27 AM | Feedback (8) | Filed Under [ SQL Server Reviews ]

Book Review: MCTS 70-431 Exam Cram: Implementing and Maintaining Microsoft SQL Server 2005

Well in my knowledge brush up for 70-431 Exam I used this book backed up by BOL. If you have previous SQL Server experience this book and BOL is all you really need to pass the Exam. If you're a newbie who is just getting it's feet wet then first get some experience and comfortability with SQL server first.   The book is a very easy read and although it has some errors they're not huge so i didn't need errata (fixed errors) for it. It nicly summarizes the topics that you need to know about and the chapters are just long enough. Content fits very nicly with...

posted @ Thursday, May 10, 2007 10:09 PM | Feedback (6) | Filed Under [ SQL Server Reviews ]

I Passed the SQL Server 2005 MCP 70-431: Implementation and Maintainance Exam

So as of today i'm a proud member of the MCP club :) The exam wasn't that hard. I had 35 "Pick a correct answer" questions and 15 simulations. The simulations threw me off a bit because i didn't expect them.  So you have to be comfortable with T-SQL syntax and Management Studio alike. Knowing what all of the little buttons and options do helps :)   The tools i used for learning are SQL Server Books Online and EXAM CRAM: MCTS 70-431: Implementing and Maintaining Microsoft® SQL Server 2005   I've read some more books but they were really not needed to pass this exam. I'll post my reviews...

posted @ Thursday, May 10, 2007 12:21 PM | Feedback (16) | Filed Under [ SQL Server Misc ]

Powered by:
Powered By Subtext Powered By ASP.NET