Posts Tagged ‘optimizing queries’

Functions – A handy tool for formatting data (among other things)

October 9, 2012 Leave a comment

Last week we started Spatial with Part 1 of a series, and we’ll get back to that on Thursday.  Today, we’ll talk about functions.  Functions are a tool that can be used by developers to perform automated data replacement, concatenation, calculations or other tasks in a much easier way:  by programming a function, then simply calling that function for the field that needs to be calculated.   There are two types, system functions and User-Defined Functions (UDF’s).  This post is going to deal with UDF’s. Read more…

Recursive Queries – Leveraging CTE’s to work for you

September 20, 2012 3 comments

Playing around with Microsoft SQL Server 2008 Express edition, I’ve sorted through a bunch of tidbits. One that I thought was interesting, is how to perform a recursive or hierarchical query. This describes how you can perform the magic.

The official name of the WITH clause in Oracle’s lexicon (otherwise known as Oraclese) is a subquery factoring clause. Microsoft has a different name for the WITH clause. They call it a Common Table Expression or CTE. You can find more on that in this earlier blog post.

Read more…

Common Table Expressions (CTE) – What they are and how to use them

September 13, 2012 3 comments

Common Table Expressions are a nice tool in SQL Server that allow you to create Temporary Tables without using TempDB.  They only exist while the query runs, whereas temp tables live for the entire session.  They are a great tool when it comes to optimizing queries, as it also reduces the load on tables at runtime.  Today, we’ll discuss what they are and how they’re used. Read more…