Register
Tuesday, March 09, 2010
 
 DBAs And ProgrammersBlog
  
News! Minimize
   
 
 Print   
 
Misc Blog Stuff Minimize
   
 
 Print   
 
The Reluctant DBA Minimize
 
 
 
 Print   
 
Reluctant DBA Minimize
   
 
  
 
Reluctant DBA Minimize
   
 
  
 
The Reluctant DBA Minimize
 
Author:CarpDeusCreated:4/18/2008 6:56 AM
As a programmer and database administrator, I've seen a lot and here I'll record bits of information about what I'm doing and how I'm overcoming various challenges

 In preparation for a two week series on Microsoft Azure and my talk at VSLive Las Vegas, I'm releasing my Azure REST-ful Interface. Point your SVN to http://reluctantdba.beanstalkapp.com/demonstrations/browse/trunk/AzureCommands and get the current version. It has both the class (Finsel.AzureCommands) and a sample WinForm app that test out all of the functionality.

While I'll be fully documenting it this weekend, just a couple of quick notes here. Most of the class returns an azureResults object. This object contains:

 

Read More »

 Microsoft's latest Cloud Computing offering is called Azure. (You can sign up for an account here if you want to follow along.) Azure is made up of two different parts: Azure Hosted Services and Azure Storage Accounts. Over the course of these blog posts, we'll be covering both and how to access them using a library that can be used with VS2005 from XP, but we're going to start with a quick overview of Azure Storage Accounts today.  The next part will cover the basics of authentication and how it differs between Azure Storage bits. Parts 3-5 of this series will cover using a REST-ful library to access each of these in turn. Part 6 will introduce Azure Hosted Services and Parts 7 and 8 will go into those in more depth.  But first, an Azure Storage Accounts is made up of three components: Azure Table Storage (ATS), Azure Blob Storage (ABS) and Azure Queue Storage (AQS).

Azure Table Storage (ATS) Azure Table Storage (ATS) is a slightly misnamed tool. It's really 

...

Read More »

 I've been doing a lot of work on preparing an existing product for conversion to our new platform. One thing that the existing product has is a lot of data contained in XML, some of which is now going to exist as real columns in the database. Most of this XML is actually NVPs so it looks like this:

elements> element elementid="name" responsetext="value">element> element elementid="anothername" responsetext="some other value">element> elements>...

Read More »

As I continue to prepare  for my talk on Azure Table Storage (ATS) at VSLive next month in Las Vegas, I am improving my ATS Web Interface. I currently have implemented a way to list the tables contained in your storage area and I've split out the component parts of the request so that you can specify the Table Name, Partition Key and Row ID. If you want to add or update data, you can fill in the Document Data section.

You can select whether you want to Select (GET), Update (PUT), Create (POST), Delete (DELETE) or Merge (MERGE) when you call the request. There's  a query section, though it has a few minor issues.

My goal for tonight and tomorrow morning before work is to get the final bugs worked out of the code so that the page works for all situations. This weekend I'll write up a tutorial on using ATS that will use the interface and demonstrate...

Read More »

And some inspiration from @BenchmarkIT and @SQLRockStar

 

On a warm summers evenin on a train bound for nowhere,I met up with the coder; we were both too tired to sleep.So we took turns a starin' out the window at the darknessTil boredom overtook us, and he began to speak. He said, "Son, I've made a life out of readin' peoples faces,And knowin' what their needs were by the way they held their eyes.So if you don't mind my sayin, I can see youre out of cycles.For a taste of your Jolt there,  I'll give you some advice." So I handed him my bottle and he drank down my last swallow.Then he bummed some Doritos and borrowed my laptop.As the night got deathly quiet, his face lost all expression."If you're gonna code the program, boy, ya gotta learn to code it right. You got to know when to code 'em, know when to spec 'em,Know when to be agile...

Read More »

NULL should mean the absence of a value. In a database table, you can define a table to contain a value or not by marking it as NULL.

In XML, you can achieve the same thing in one of two ways. First, you can leave the element out of your XML. Second is you can leave the element without a value. When SQL Server parses XML, however, it can cause some strange values. Take the following code snippet:

DECLARE  @test XML SET @Test = '' SELECT @test.Value('data(/root/ThisShouldBeNull)[1]','int'); SELECT @test.Value('data(/root/ThisShouldBeNull)[1]','varchar(10)'); SET @Test = '' SELECT @test.Value('data(/root/ThisShouldBeNull)[1]','int'); I expected this to return three NULL statements before this morning. But I was surprised to find that it actually returned a 0 for the first SELECT, a space for the second select and a NULL only for the third.

As I was explaining this to Mike Amundsen he said that it does make a sort of sense, since the first...

Read More »

We've been working in this building for almost a year and a half and the owner has had a new elevator in place for most of that time but hasn't been able to activate it because the all cement building required a building wide fire alarm system installed. That was finally finished a couple of weeks ago and we're waiting for the inspection but I suspect it may take a bit longer when they see this pull just inside the front entry of the building.

FireAlarmFail

I recently modified a stored procedure at work and ended up removing a sort order and was reminded that Explicit Sort Order Matters.

The short version of the procedure is that it fills a temporary table with data, does some manipulation of that data and then returns a subset of the data. The problem was, the data contains an NTEXT column which contains XML data. Before you ask, the system was architected before SQL 2005 and the XML choice wasn't available. After the database was moved to a 2005 server, there was no need to change the data to XML because the database doesn't actually care about the data, it handles information used by the client.

NTEXT columns can be expensive, even in a temporary table, and especially when you've got several thousand rows to be slinging about and the average data length in the NTEXT is a tad under 1K. So, to optimize performance, I removed the NTEXT from the temporary table and added it in using a JOIN at the end of the procedure.

select *, Row_Number() OVER(ORDER...

Read More »

 
 
 Print   
 
Privacy Statement | Terms Of Use Copyright 2001-2008 by ReluctantDBA.com