I want some Moore

Blog about stuff and things and stuff. Mostly about SQL server and .Net
posts - 219, comments - 2287, 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

September 2007 Blog Posts

.Net: Passing user data with Exception back to the caller method

We're all familiar (i hope :)) with this construct:try { // ... some code here ... } catch (Exception ex) { // one of these 2 lines are usually seen throw; // presereves the full call stack //throw ex; // changes the origin of exception to this method } finally { // more stuff here }   It's a standard error catching routine in .Net. But what if you want to pass some user info back to the caller method with the Exception being thrown? Reader... meet Exception.Data. Exception.Data... meet reader. Now that you're both properly aquainted...

posted @ Monday, September 24, 2007 5:36 PM | Feedback (5) | Filed Under [ .Net ]

SSMS Tools Pack - an add-in for SQL Management Studio 2005 is out (beta stage)

SSMS Tools Pack is an Add-In (Add-On) for Microsoft SQL Server Management Studio 2005 and Microsoft SQL Server Management Studio Express 2005. It contains a few upgrades to the IDE that I thought were missing from Management Studio. These are:  - Query Execution History (Soft Source Control): saves every query text you execute in a file or in a database  - Text document Collapsable Regions and Debug sections: regions and debug section known from Visual Studio which are missing in SSMS  - New query template: set the template that will open when you open a new query  - CRUD (Create, Read, Update, Delete) stored procedure generation:...

posted @ Thursday, September 20, 2007 3:16 PM | Feedback (37) | Filed Under [ SQL Server SSMS Tools Pack ]

Back To Basics: What is a Clustered and a Non-Clustered index (plus an appealing visual prop)

Indexes are a constant problem in understanding for beginners (and the "not so beginners") in the database world. And don't you just love the hardcore mathematical explanation of B-Trees and their traversal. Personaly I much rather have visual props and a story to support an explanation. Appealing visual props are even better. That's how this post originated.  So let us begin!    Imagine you live in a pre-computer-in-every-nook-and-crane world (around 1960's :)).   You wake up one morning with a huge craving to read Agatha Christie's books. So you go to the library which has a few million books.  You walk up to the cute librarian (look...

posted @ Tuesday, September 18, 2007 8:15 PM | Feedback (24) | Filed Under [ SQL Server Back to Basics ]

SQL Server: The proper and fastest way to check if rows matching a condition exist

You wouldn't believe how many times i've seen this code IF (SELECT COUNT(*) FROM Table1 WHERE ... ) > 0   It's understandable though. Logically it's the easiest way to write "if there are any rows matching my condition do this". But it's also wrong. Plainly and simplly wrong! Why? Because when you do a count(*) there is no way to get around an index range scan or a full table scan. For a large resultset this will be a huge resource hog. So how do i do this you might ask yourself? Very simple:  Use EXISTS! IF EXISTS(SELECT * FROM Table1 WHERE ...)   Exists stops the execution as soon as...

posted @ Thursday, September 13, 2007 5:58 PM | Feedback (13) | Filed Under [ SQL Server ]

How does SQL Server really store NULL-s

I've been asked this question so many times now that it'd be easier if i just gave people a link to read. :) So in short (for those who are too lazy to dwelve deeper into sql internals): Each row has a null bitmap for columns that allow nulls. If the row in that column is null then a bit in the bitmap is 1 else it's 0. For variable size datatypes the acctual size is 0 bytes. For fixed size datatype the acctual size is the default datatype size in bytes set to default value (0 for numbers, '' for chars).   Let's have two simple table t1 and t2....

posted @ Thursday, September 06, 2007 10:50 PM | Feedback (7) | Filed Under [ SQL Server ]

Little .Net tip: Start using List<T>.ForEach()

I haven't been using this function at all. Who knows why... maybe because i didn't know about it :) But in my latest pet project i had to do something really quickly on a lot of items in a list. After a bit of research into foreach and for loops, i saw the List<T>.ForEach method.   Did some testing and sure thing List<T>.ForEach proved to be faster than others.   I thought about posting the whole setup and how i've tested it, but then i saw that Dustin Russell Campbell did exactly the same thing a bit more thoroughly, so why double it up, right? Read it, like...

posted @ Saturday, September 01, 2007 9:37 PM | Feedback (9) | Filed Under [ .Net ]

Powered by:
Powered By Subtext Powered By ASP.NET