KnoxSQL an official SQL Server User Group


Watch out Knoxville! I have officially started a PASS Chapter in Knoxville,TN called KnoxSQL.

Stay tuned for meeting information.

As of right now my plan is to do a lunch time meeting at New Horizons off Cedar Bluff once a month or so, and maybe throw in a SQL Saturday if I see enough interest.

If you would like to come and hear the latest topic, or even volunteer to help out, let me know!



querying xml…


I need my query to return:

bar1
bar2
foo3
bar4

Here is what I have so far… I also tried to use a while statement to loop through… no luck(any ideas?):

DECLARE @xmlString XML;

SET
@xmlString = N’

<a promotion=”PL10ONL”>
<product-id>bar1</product-id>
<product-id>bar2</product-id>
<product-id>foo3</product-id>
<product-id>bar4</product-id>
</a>

SELECT ISNULL(T.lala.value(‘./product-id[1]‘,‘varchar(20)’),‘found nothing’)
FROM @xmlString.nodes(‘a’) AS T(lala);

SELECT ISNULL(T.lala.value(‘./product-id[2]‘,‘varchar(20)’),‘found nothing’)
FROM @xmlString.nodes(‘a’) AS T(lala);

/*====================================*/

edit post:

Got it!!! Joy!


DECLARE @xmlString XML;

SET @xmlString = N’
<a promotion=”PL10ONL”>
<product-id>bar1</product-id>
<product-id>bar2</product-id>
<product-id>foo3</product-id>
<product-id>bar4</product-id>
</a>’

SELECT s.lala.value(‘@promotion’, ‘varchar(20)’),T.lala.value(‘.’, ‘varchar(20)’)
FROM @xmlString.nodes(‘a/product-id’) AS T(lala)
OUTER
apply @xmlString.nodes(‘a’) AS S(lala)



Where I’ll be at the SQL PASS Summit!


The Professional Association of SQL Server has a Summit every year in Seattle. (One in Europe too.) This year I vowed I would go. Paid for the conference myself and on November 2nd at 8:40 my flight leaves for Seattle,Washington.

Dolly - the first mammal to be cloned

Hello Dolly

Here is where you can find me at the SQL PASS Summit.

Yes, I sometimes have three sessions I want to attend in the same hour… decisions decisions…how is that cloning process going?


Monday:

  • 1:37pm flight arrives in Seattle
  • 3pm Check in at the Sheraton Seattle and register for the Summit
  • ??? Seattle photowalk
  • 6:30pm - 8:00pm PASS Summit Unite 2009 Welcome Reception
  • 8pm till ?? SQL Server Central party (maybe)

Tuesday:

  • 7:45 AM - 8:15 AM Opening Remarks (Wayne Snyder)
  • 8:15 AM - 10:00 AM Keynote Speaker Day 1 - Bob Muglia & Ted Kummert
  • 10:15 AM - 11:30 AM [BID-201-M] Business Intelligence with Excel 2010 and Project Gemini
  • 10:15 AM - 11:30 AM [BIA-140-M] Introducing Master Data Services
  • 10:15 AM - 11:30 AM [PD-307] Soft Skills - Now More Than Ever
  • 1:30 PM - 2:45 PM [BID-110-M] Introducing Project Gemini
  • 3:00 PM - 4:15 PM [DBA-131] The Ultimate Free SQL Server Toolkit
  • 3:00 PM - 4:15 PM [BIA-411] SQLBI Methodology
  • 4:30 PM - 5:45 PM [PD-108] Social Computing for the Database Professional
  • 4:30 PM - 5:45 PM [BIA-206-M] Overview of Business Intelligence capabilities in SQL Server 2008 & R2
  • 4:30 PM - 6:00 PM [BIA-329-S] Loading a Data Warehouse with SSIS

Wednesday:

  • 7:00 AM - 8:30AM – Quest breakfast thingy (maybe)
  • 8:30 AM - 9:00 AM Daily Remarks & Passion Award (Rushabh Mehta)
  • 10:15 AM - 11:30 AM [BIA-207-M] An End-to-End Introduction to SQL Server Reporting Services
  • 11:30 AM - 1:30 PM - Women In Technology Luncheon
  • 1:30 PM - 2:45 PM [BIA-201-M] BI Power Hour
  • 1:30 PM - 2:45 PM [AD-312] Database Design
  • 3:00 PM - 4:15 PM [BIA-107] The DW/BI System Lifecycle Overview the Kimball Approach
  • 3:00 PM - 4:15 PM [BIA-334] Overcoming SSIS Deployment and Configuration Challenges
  • 3:00 PM - 4:15 PM [PD-302] Working in Management Will Rot Your Brain - How to Stay Technical and Advance Your Career
  • 4:30 PM - 6:00 PM [BIA-335-S] Data Profiling and Cleansing with Integration Services 2008

Thursday:

  • 7:00 AM - 8:30AM – VMware Breakfast thingy (maybe)
  • 8:30 AM - 9:00 AM [] Daily Remarks (Bill Graziano)
  • 9:00 AM - 9:20 AM [] Dell Vendor Keynote
  • 9:20 AM - 10:20 AM [] Keynote Speaker Day 3 - David Dewitt
  • 10:45 AM - 12:00 PM [PD-106] Team Management Crash Course
  • 1:00 PM - 2:15 PM [PD-101] Achieving Work-Life Balance - What does it really mean?
  • 1:00 PM - 2:15 PM [AD-307] Yes, I’m Actually Using The Cloud
  • 2:30 PM - 3:45 PM [BIA-115] Understanding Master Data Management and the Benefits
  • 2:30 PM - 3:45 PM [DBA-327-M] Proactive DBA: Manage SQL Server Better
  • 4:00 PM - 5:15 PM [DBA-421] Using Agile Development Techniques with Integration Services

Friday:

  • 11:45am Flight leaves for home

Of course I’ll have to find time somewhere to play BINGO!!



All good things…


The ETL database my friend and I wrote is going to launch into production Tuesday. It’s like our child’s first day of kindergarten.

There are at least 20 jobs that were not required for launch, those will need to be done in the upcoming months. It’s been almost a year since this project began. A giant endeavor which ultimately ends in a new shiny website with better analytics, promotional control, and user experience.

I’ve learned so much, granted there were, and still will be, moments where I will want to pull my hair out. But what an awesome thing to create from the bottom up?!



SSIS Configuration notes


The way I understood it, if you put a value in “set values” within your job step (calling an SSIS Package) it would overwrite what was in the SSIS Configuration table… apparently I was wrong. I tested this today. SSIS Configuration table is the winner.



How I became a Database Programmer


It all began in March of 2001. I survived 3 rounds of layoffs at Earthlink, an Internet service provider, but didn’t make the final round. A few weeks later I was hired by a small company (at the time) named Marketlinx.

Marketlinx writes Multiple Listing Service software for Realtors. I generated reports from listing data, and helped with cosmetic ASP/Javascript type work, which required me to query the database from time to time.

Over the next five years I became very familiar with the software, but felt that I wanted to focus more on the inner workings of the database. In April 2006 I was moved into a database programmer position. I was already familiar with the data and SQL Server 2000/2005. Anything I didn’t know I asked or researched on the web. I took many self paid for classes, I was totally amazed at what I could do.

After almost 3 years as a DBA, my database career took on a new direction, I was hired to join a team that would write a brand new data warehouse with SQL Server 2008, using SSIS, for a large Ecommerce company. This is something a DBA gets to do what, once or twice in a career?

Now, our warehouse is almost complete. I’ve learned so much and evolved with the software. I’ve made new friends in the database industry, and try to keep up with the not so local Nashville SQL Server User group. I have hopes of starting a Knoxville group later this year. I also registered for the annual Microsoft SQL PASS convention in Seattle.

I love my job and I’m excited about what I do, I don’t claim to be an expert, but every day I learn something new.

So there you go, that’s how I got to be a DBA, and I love it. :)



random thoughts


You know you’re a nerd when you lay around at night wondering…

Right now our SSIS configurations are stored in a control table in our primary database. However when installing an SSIS package if you do not choose an xml config you do not get prompted to change the connection string for the database (or any value you selected to be configurable). The config on the QA/Stage box just automagically has the correct connection string. But, I’m wondering if this is a feature or a flaw. If I’m not the one installing the package this might be a bad thing… hmmmm.

Also, right now we have a slowly changing dimension checking every attribute of a product for changes, the table is is checking has at least a million records… after going to the Nashville SQL Server User group I was told that this isn’t performant, but one product has many many attributes, so using multiple lookups is not an option. I’m thinking we are going to have to somehow do a large join on my staging table, or find another solution. But really right now the process doesn’t take THAT long, so in reality, we will probably leave it alone.



I upgraded my blog…


to a newer version of Wordpress, and It seems to have lost some functionality. Getting it fix asap.



so I have this little job…


it’s small and very funny*

Okay it’s not so small but it’s called by a web service which updates a table that fires a trigger that starts the job(not my design) which updates an activity table and also starts my SSIS packages spinning. But I also want the job to fire, should the web service fail to call it.

All in all it seems really messy. I need to make it cleaner.

Also, SQL server 2008 offers a beautiful job status API however  helpdesk has no access to my production server to use it to see what happened to a failed job at 3am. So I need it in a format that someone who has very little access to the database to see.

I once wrote an ASP web application that would take all job status and show a green, yellow, or red light on the page depending on the health of the job. I may have to do something like that again. Unless there’s something already out there that would save me the work.

So those are my two big questions for now. Input is welcome. :)



Pivot Data Flow Transformation in SSIS


I’ve been working strictly with SSIS in SQL Server 2008 for a a little over month now. It’s an amazing tool.

One thing I encounter when generating horizontal tables from adata warehouse is the factthat I have to pivot tables. Last week, when trying to pivot data using the “Pivot Task” I got the error:

“Cannot convert the pivot key value_ to the data type of the pivot key column.” (The underscorereplacesthe name of the output column I had created. )

Thing is, I was trying to be fancy, In my OLE DB Source I had decoded mycolumn names from numbers to text.

This bit me in the end. I couldn’t figure out why I was getting an error. But here was the solution.

Pass the numbers in and name them under your PivotKeyValue.

Correct:

SELECT[1AnchorColumn], [3PivotValue], [2PivotKey]
FROM [AdventureWorksDW].[dbo].[Table]

output column 1 “Blankets” PivotKeyValue=125 Name=Blankets SourceColumn=LineageID from Input

output column2 “HomeOffice” PivotKeyValue=126 Name=HomeOffice SourceColumn=LineageID fromInput

output column3 “Kitchen” PivotKeyValue=300 Name=Kitchen SourceColumn=LineageID fromInput

Incorrect:


SELECT
[1AnchorColumn], [3PivotValue],[2PivotKey] =
CASE [2PivotKey]
WHEN 125THEN ‘Blankets’
WHEN 126 THEN ‘HomeOffice’
WHEN 300 THEN ‘Kitchen’
ELSE ‘Other’END
FROM
[AdventureWorksDW].[dbo].[Table]

output column 1 “Blankets” PivotKeyValue=Blankets Name=Blankets SourceColumn=LineageID from Input

output column2 “HomeOffice” PivotKeyValue=HomeOffice Name=HomeOffice SourceColumn=LineageID fromInput

output column3 “Kitchen” PivotKeyValue=Kitchen Name=Kitchen SourceColumn=LineageID fromInput

The logic was that characters were coming from a field that was an integer. Thus the error:

“Cannot convert the pivot key value _ to the data type of the pivot key column”

Hope this helps you in your pivoting woes. I figured it myself! Brian Knight would be proud. ;)

Toodles!

(I really will try to post more often!)