Archive

Posts Tagged ‘Database Operations’

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…

Basic Querying in SQL Server

September 11, 2012 Leave a comment

Today we’re going to talk about querying a database in SQL Server.  Queries can be really simple or nearly infinitely complex.  But that complexity can be deceiving, as it all breaks down to multiple combinations of the simple aspects of querying.  Today, we’ll discuss selecting items from a database and limiting those results to get results the way we want them.  You should have SQL Server 2008R2 and the AdventureWorks2008R2 database installed on your system.  If you don’t already, see the “Software”  link above. Read more…