Search
Blogland
Author: host Created: 7/22/2007 6:21 PM
This professional blog focuses on SQL Server and related activities in Indianapolis

Out On A Limb: Philosophy Meets SQL Server
By host on 2/26/2008 12:57 AM

I recently ran across some articles that discussed the philosophical implications of Quantum Mechanics which made for very interesting and thought provoking reading. A piece of those articles really grabbed my brain: It was the concept of a probabilistic universe vs. a deterministic universe. While I cannot even begin to claim to be a philosopher, a theologian or a quantum mechanic, I thought it would be interesting to express these concepts, at an extremely simplified manner, in what I consider my realm: SQL Server.

According to the American Heritage Dictionary, the definition of determinism is: “The philosophical doctrine that every state of affairs, including every human event, act, and decision is the inevitable consequence of antecedent states of affairs.”

In SQL Server terms determinism might best be described as follows: The occurrence of a specific set of data does not appear randomly. While the exact event or act that begins the process of the dat ...

More...

Temporary Tables - Table Variables: Did you ever have to make up your mind?
By host on 2/17/2008 12:58 AM

There will certainly come a time in the development of a database where you will encounter the need for either a temporary table or a table variable. The first question that any developer must ask is whether the need for these items is truly necessary. In some cases, a derived or correlated query can address the need at hand. Utilizing a UNION join, in some cases, could also be an alternative to consider.

Once it is determined that the use of either a temporary table or table variable is indeed appropriate for the task at hand, the next question that comes to mind is the selection of the optimal choice. Before we dive into the comparison between these options, let's take a quick look at the syntax:

To create a temporary table, the syntax is as follows:

CREATE TABLE #TEMP (
FIELD1 INT,
FIELD2 VARCHAR(50) NULL,
FIELD3 VARCHAR(50) NULL
)

More...

SET vs. SELECT
By host on 2/7/2008 4:31 PM

The use of local variables within T-SQL is something that is very common. The two methods in which to assign a value to a local variable are using the SET or SELECT methods. I have seen both used rather frequently and interchangeably in my years of reviewing T-SQL.

The way that the SET method is used when assigning a value to a local variable is:

    SET @localvariable = ‘Test’

The way that the SELECT method is used when assigning a value to a local variable is:

    SELECT @localvariable = ‘Test’

Having a choice, the natural question is which should be used?

If you follow the ...

More...

What is a Bookmark Lookup?
By host on 2/6/2008 10:39 AM

While evaluating execution plans one may notice an occurrence that is called a bookmark lookup. These bookmark lookups can have a damaging affect on the performance of your query or stored procedure. A bookmark lookup occurs when there is data being retrieved using a non-clustered index.

To understand how bookmark lookups work, we must begin at an item called a "page". A page is 8 kilobytes of data. The page is where the reading, writing and storage of the database occurs. The leaf-level, or node page, contains either key values or pointers to the underlying data.

If the leaf-level contains key values, the data that is stored at the leaf-level is stored in ascending order. These key values are called a clustered index. In this case the leaf-node contains actual data that can be recalled directly from the leaf-level.

If the leaf-level contains a pointer, or bookmark, to a heap table it is called a non-clustered index. A heap table is ...

More...

Ken Henderson
By host on 1/31/2008 10:08 PM
It was quite a shock this morning when the news of Ken Henderson's passing came my way. I never personally met Ken; but I do know many who have. All have had very positive things to say about him. He shared his knowledge and love of SQL Server very generously. His now famous "Guru's Guide" books are a coveted item for many in our field.

The blog entries and forums that are making note of Ken's contributions is an amazing testimony to the benefits of getting involved in not only your local community of professionals but also reaching out to those who are still learning the ropes. Ken certainly was a model citizen in the land of SQL and his circle of influence was much wider than even he may have realized.

We'll miss you Ken.

Here are some links to some of his books:
-
More...

SQL Server Community Worldwide
By host on 1/21/2008 7:38 AM
It was brought to my attention that there was a site being developed that is intended to be the hub of all things SQL Server. This site is packed full of tips, articles, forums, links and other information that will be valuable for the SQL Server professional.

To visit the site go to: www.SQLCommunity.com.

Performance Benefits of Sub-Queries
By host on 1/15/2008 2:24 AM

When querying large datasets the strategic assembly of the query's tables are as important as the assembly of the WHERE clause. The joining of a sub-query instead of a standard joining of tables can result in performance gains. The benefit comes from the order of execution; the sub-query is executed prior to the joining of the other tables which could result in attempting to join less rows of data.

The following query unions two tables that join to the PRODUCT table:

SELECT  
        Production.Product.ProductID,
        Production.Product.Name,
        Production.Product.ProductNumber,
        Production.TransactionHi ...

More...

Great Start To A Year!
By host on 1/3/2008 8:14 PM
My first widely published article occured today on DevX.com. It's title is Evaluating How Filtering Options Affect T-SQL Performance. This is a great way to start a new year! I anticipate authoring more articles in 2008. In fact, I am working on my next article on the subject of Threat Modeling which will also be published by DevX. The date of publication for my next article is to be determined.

Click here to go directly to the Evaluating How Filtering Options Affect T-SQL Performance article.

Enjoy!

Indexing Strategies
By host on 12/28/2007 9:13 AM
At the most recent IndyPASS meeting, Tom Pizzato presented on the subject of Indexing Strategies. Tom's presentation was packed with detail that ranged from introducing the concept of indexing as well as discussing performance considerations at the page level.

This presentation was exceptional and so much so that I wanted to make note of it here in my blog. A great point discussed in this presentation was that while in general table scans in a query are not desireable there are times where they are more efficient than an index seek. For example: If you were querying a 100 row table.

Also noted was how the order of execution in a WHERE clause can effect the performance of a query as well as its use of indexes.

There was alot of great information and not enough time to fit it all in. A special thanks to Kimberly Tripp who provided Tom with a large portion of the information presented by Tom. To download Tom's slidedeck,
More...

SQL Server 2008 Cometh
By host on 12/16/2007 10:36 PM

Like most real world developers and DBAs, I am working with multiple SQL Server versions at the same time. I currently work with SQL Server 2000 in one project while working with SQL Server 2005 in another. To further this experience, I recently had a discussion with a peer who just completed a project to move SQL Server 7 to SQL Server 2000. Some businesses are more eager to adopt the latest and greatest software while others take the “wait and see” or “if it ain’t broke don’t fix it” approach.

We now find ourselves on the cusp of another version of SQL Server. This really begins the new Microsoft eighteen month release plan. This plan is very aggressive; but so is the software and database marketplace. SQL Server has become quite a complex platform and frequent improvement and innovation is not only desired but essential to its survival and competitiveness.

Regardless of whether one feels that this new version is too soon or just in time, it is fast approaching and Microso ...

More...

Copyright 2007 John Magnabosco