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

Back to Basics

SQL Server: Writing CASE expressions properly when NULLs are involved

We’ve all written a CASE expression (yes, it’s an expression and not a statement) or two every now and then. But did you know there are actually 2 formats you can write the CASE expression in? This actually bit me when I was trying to add some new functionality to an old stored procedure. In some rare cases the stored procedure just didn’t work correctly. After a quick look it turned out to be a CASE expression problem when dealing with NULLS. In the first format we make simple “equals to” comparisons to a value: ...

posted @ Monday, March 18, 2013 9:55 PM | Feedback (7) | Filed Under [ SQL Server Back to Basics ]

SQL Server MVP Deep Dives 2. The Awesome Returns.

Two years ago 59 SQL Server MVP's came together and helped make one of the best book on SQL Server out there. Each chapter was written by an MVP about a part of SQL Server they loved working with. This resulted in superb quality content and excellent ratings from the readers. To top it off all earnings went to a good cause, the War Child International organization. That book was SQL Server MVP Deep Dives. This year 63 SQL Server MVPs, me included, decided it was time do repeat the success of the first book. Let me introduce you the: SQL...

posted @ Friday, October 07, 2011 7:26 PM | Feedback (0) | Filed Under [ SQL Server Reviews Back to Basics ]

SQL Server SQL Injection from start to end

SQL injection is a method by which a hacker gains access to the database server by injecting specially formatted data through the user interface input fields. In the last few years we have witnessed a huge increase in the number of reported SQL injection attacks, many of which caused a great deal of damage. A SQL injection attack takes many guises, but the underlying method is always the same. The specially formatted data starts with an apostrophe (') to end the string column (usually username) check, continues with malicious SQL, and then ends with the SQL comment mark (--) in order...

posted @ Wednesday, February 16, 2011 7:00 AM | Feedback (2) | Filed Under [ .Net SQL Server Back to Basics ]

Plagiarism and second chances

I was wondering what i should write about for my 200th blog post. And I’m in luck because Karma’s got my back and that’s why yesterday we had an interesting case of plagiarizing. So let’s get optimistic! A relatively new blogger called SQLDigs copied this post of mine about new version of SSMS Tools Pack. Because there was no trackback or any other link back to my blog I had no idea until David Levy (Blog|Twitter) told me about it. As I’ve looked over the other content of the blog I’ve noticed quite a few familiar paragraphs of...

posted @ Tuesday, September 14, 2010 9:00 AM | Feedback (7) | Filed Under [ SQL Server Back to Basics ]

SQL University: Database testing and refactoring tools and examples

This is a post for a great idea called SQL University started by Jorge Segarra also famously known as SqlChicken on Twitter. It’s a collection of blog posts on different database related topics contributed by several smart people all over the world. So this week is mine and we’ll be talking about database testing and refactoring. In 3 posts we’ll cover: SQLU part 1 - What and why of database testing SQLU part 2 - What and why of database refactoring SQLU part 3 - Database testing and refactoring tools and examples This is the third...

posted @ Friday, June 04, 2010 2:53 PM | Feedback (3) | Filed Under [ SQL Server Back to Basics ]

SQL University: What and why of database refactoring

This is a post for a great idea called SQL University started by Jorge Segarra also famously known as SqlChicken on Twitter. It’s a collection of blog posts on different database related topics contributed by several smart people all over the world. So this week is mine and we’ll be talking about database testing and refactoring. In 3 posts we’ll cover: SQLU part 1 - What and why of database testing SQLU part 2 - What and why of database refactoring SQLU part 3 - Database testing and refactoring tools and examples This is a second...

posted @ Wednesday, June 02, 2010 9:41 PM | Feedback (0) | Filed Under [ SQL Server Back to Basics ]

SQL University: What and why of database testing

This is a post for a great idea called SQL University started by Jorge Segarra also famously known as SqlChicken on Twitter. It’s a collection of blog posts on different database related topics contributed by several smart people all over the world. So this week is mine and we’ll be talking about database testing and refactoring. In 3 posts we’ll cover: SQLU part 1 - What and why of database testing SQLU part 2 - What and why of database refactoring SQLU part 3 - Database testing and refactoring tools and examples With that out of...

posted @ Monday, May 31, 2010 7:12 PM | Feedback (0) | Filed Under [ SQL Server Back to Basics ]

SQL Server Date and Time fun from all around

A few days ago Adam Machanic proposed a great idea about a T-SQL Tuesday. Every Tuesday there would be a topic bloggers all around would post about. Chosen as the first topic was the date and time stuff in SQL Server. Because there’s already all this great content out there I’m not going to repeat it but I’m going to put together a ton of datetime resources from SQLTeam forums and blogs as a resource you can use in the future.   Michael Valentine Jones MVJ as we like to call him in the forums has a thing for datetime manipulation. He has...

posted @ Tuesday, December 08, 2009 6:41 PM | Feedback (6) | Filed Under [ SQL Server Back to Basics ]

Why I prefer surrogate keys instead of natural keys in database design

Simply put: I prefer using surrogate keys because natural keys are by default a subject to change which is a bad behavior for a row identifier. But let’s dig a bit deeper into each key type to see why this is. Here’s a little table with column names that tell us what kind of a key each column is. Surrogate keys A surrogate key is a row identifier that has no connection to the data attributes in the row but simply makes the whole row unique. And that property is also the downside of it. Because it has no connection to the data...

posted @ Tuesday, October 06, 2009 1:17 PM | Feedback (49) | Filed Under [ SQL Server Back to Basics ]

Why would Visual Studio build always rebuild a solution?

Today I had an interesting problem. If I rebuilt my solution every thing would succeed but after that if i pressed F5 (build) the whole solution would get built again but it would error out. Now this doesn’t make any sense because the difference between Build and Rebuild is that Rebuild always compiles and links all files + all dependencies, while Build only compiles and links files that have changed since the last build. So everything should be fine. The thing about our solution is that the we have some post build events that do some IL merge, etc… the...

posted @ Monday, August 24, 2009 1:31 PM | Feedback (0) | Filed Under [ .Net Back to Basics ]

Adding one file to multiple projects in a .Net solution

There are times when you want to have one .cs file in multiple projects. However if you do Add existing item you’ll notice that the file is copied to each project’s folder. This is not what we want. The solutions is of course pretty simple once you know where to look. In the Add existing item dialog you have to add the file as a Link as is shown on the picture:   And there you go. you can have one file in multiple projects.

posted @ Friday, June 05, 2009 4:03 PM | Feedback (2) | Filed Under [ .Net Back to Basics ]

Normalization for databases is like Dependency Injection for code

Let us start with a simple question: What is the goal of software development, be it database or .Net (or any other language)? The first answer would be: Customer satisfaction! And you'd be right. However there's more to customer satisfaction then the immediate product delivery effect. We have to think about future change requests, maintenance periods, etc... Almost every business application out there consists of 2 basic parts: database back end and some kind of front end that consumes the data. In our case the front end is anything with access to the database. In regard to future code...

posted @ Wednesday, September 17, 2008 10:38 AM | Feedback (6) | Filed Under [ .Net SQL Server Back to Basics ]

Back to Basics: Count, Count, Count, Sum or how to Count

Probably everyone is familiar with the Count(*) function in SQL Server. But there seems to be a great deal of confusion amongst youngsters (SQL wise) about how all its possible options work. Let us banish the confusion back to the dark realms where in belongs to: DECLARE @t TABLE (val INT) INSERT INTO @t SELECT 1 UNION ALL SELECT 1 UNION ALL SELECT NULL UNION ALL SELECT NULL UNION ALL SELECT 4 UNION ALL SELECT 4 UNION ALL SELECT 5 SELECT COUNT(*) AS CountAll, -- counts all rows COUNT(val) AS CountAllNoNull, -- counts rows that don't contain NULL COUNT(DISTINCT val)...

posted @ Monday, February 04, 2008 5:24 PM | Feedback (4) | Filed Under [ SQL Server Back to Basics ]

How to solve problems and why is that perceived as hard?

it's my opinion that today we unfortunately live in a world that requires some kind of harder problem solving skills from maybe 20% of the population. And I'm being very very generous. So putting that percentage with the question in the title would give an answer similar to: "Because not every one can do it." DOH, right?  I'd say you're wrong since everyone had a problem to solve at least once in a lifetime. So what's the problem? Why is it perceived as hard? Let's take a little trip through your past. When you were just an infant, what was...

posted @ Tuesday, December 18, 2007 9:48 AM | Feedback (7) | Filed Under [ Back to Basics ]

Introduction to locking in SQL Server 2005

  I've written an article here on SQL Team about locking in SQL Server. It's an introductory article that shows lock modes, lock granularity and lock compatibility matrix and it will be followed by a few more advanced ones on the topic of locking.   Part 1:  Introduction to locking in SQL Server 2005

posted @ Wednesday, December 12, 2007 8:36 PM | Feedback (3) | Filed Under [ SQL Server Back to Basics ]

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 ]

Powered by:
Powered By Subtext Powered By ASP.NET