I Did It “MY WAY”

I have spent hours trying to write this post.  It’s very hard to talk about my time at this company without becoming emotional.  But here it goes…

In September 2005 I had just left a very negative work environment.  My previous director had sent an e-mail to me [cc’ing HR] that said, in a very derogatory way, they didn’t need a DBA at their company and that I should just leave before I was to be fired.  It had been very stressful to be in such an environment and when I got this e-mail just made me loose all hope.  The next day I received an e-mail from HR apologizing for his statement and was offered a package to leave the company.  I gladly took it.

It only took me 2 weeks to find my current position.  My 7 year love affair started out as a Sybase contracting job that lead to a full-time SQL Server DBA position, an acquisition by Motricity.  During the years I have done numerous projects [Sybase ASE -> SQL 2005; Sybase IQ -> SQL 2012; etc], TAP engagements and worked closely with some of the best developers and data professionals in our industry.  It is through this job that joined Twitter and met people like Buck Woody, Jimmy May, Mike Ruthruff, Allan Hirt, Cindy Gross, Lara Rubbelke, Susan Price, Denny Lee, Kathy MacDonald, Mark Souza, … [the list goes on and on].   Last night, at my goodbye party, I met old and new friends who came out to celebrate my time here and speak of the future.  It was the best time I have had in many months.  I want to thanks those who came and made me feel special.

I really don’t know what else I can say.  But Frank Sinatra sang it best:

Yes, there were times, I’m sure you knew 
When I bit off more than I could chew 
But through it all, when there was doubt 
I ate it up and spit it out 
I faced it all and I stood tall and did it my way 

I’ve loved, I’ve laughed and cried 
I’ve had my fill, my share of losing 
And now, as tears subside, I find it all so amusing 
To think I did all that 
And may I say, not in a shy way, 
“Oh, no, oh, no, not me, I did it my way” 

For what is a man, what has he got? 
If not himself, then he has naught 
To say the things he truly feels and not the words of one who kneels 
The record shows I took the blows and did it my way!

Simple UDF to generate columnstore index

This is a simple UDF which will generate the SQL code to create a columnstore index on all columns in a given table.  You need to supply the table schema, table name, index name, whether you are dropping an existing index and finally the MAXDOP.  Although the order of the columns does not matter in a columnstore index I kept the column output ordered.

NOTE:  Because computed columns are currently not supported in columnstore indexes the code ignores such columns from the index creation.

Let me know what you think.

 

CREATE FUNCTION [dbo].[GenerateColumnStoreIndex] (@TableSchema VARCHAR(100), @TableName VARCHAR(100), @IndexName VARCHAR(50), @DropExisting BIT, @MAXDOP INT=6 )
RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @output VARCHAR(MAX) = ”,
@columnList VARCHAR(MAX) = ”,
@i INT = 0,
@count INT,
@ColumnName VARCHAR(150),
@Drop VARCHAR(20)

SET @DROP = CASE WHEN @DropExisting = 1 THEN ‘ON’ ELSE ‘OFF’ END

— Figure out the number of columns to be added.
DECLARE curColumns CURSOR READ_ONLY
FOR SELECT ‘[‘+ COLUMN_NAME +’]’
FROM INFORMATION_SCHEMA.COLUMNS WITH (READUNCOMMITTED)
WHERE TABLE_NAME = @TableName
AND TABLE_SCHEMA= @TableSchema
AND COLUMN_NAME NOT IN (SELECT sc.name
FROM syscolumns sc
JOIN sysobjects so ON sc.id=so.id
WHERE so.name = @TableName
AND sc.iscomputed=1)
ORDER BY ORDINAL_POSITION ASC

OPEN curColumns

FETCH NEXT FROM curColumns INTO @ColumnName

WHILE( @@FETCH_STATUS = 0 )
BEGIN
SET @columnList += + CHAR(10) + @ColumnName + ‘,’

FETCH NEXT FROM curColumns INTO @ColumnName
END

CLOSE curColumns
DEALLOCATE curColumns

SET @output += ‘CREATE NONCLUSTERED COLUMNSTORE INDEX [‘ +@IndexName+ ‘] ON [‘ +@TableSchema+ ‘].[‘ +@TableName+ ‘]’
SET @output += CHAR(10) + ‘(‘
SET @output += CHAR(9) + LEFT( @columnList, DATALENGTH(@columnList)-1)
SET @output += CHAR(10) + ‘)’ + CHAR(10)
SET @output += ‘WITH (DROP_EXISTING = ‘ +@Drop+ ‘, MAXDOP = ‘ +CAST(@MAXDOP AS VARCHAR)+ ‘)’ +CHAR(10)

RETURN @output
END

Diverticulitis

Some people may know that on 06/10/2011 I came down with a horrible pain in my lower left abdominal area at work.  The pain was so severe that I had to come home and the next 2 days was the worst pain I had ever gone through.  On 06/13/2011 I went to see my doctor and was then rushed to the hospital because of Diverticulitis and being septic.  I spent the next 5 days being given all kind of antibiotics, 3 days of not eating or drinking, to recover from this.  Unfortunately Diverticulitis is not something you can get rid of easily.  I saw specialists and in the end it is something I will live with or if it gets worse I will have to have part of my large intestine removed.

I say this right now not because I enjoys sharing my personal medical issues with the world but rather that on Friday, after SQL PASS, the symptoms came back.  Thankfully I did not wait and saw a doctor on Saturday.  I am on antibiotics again.  My problem is that I don’t know when this will go away or if it ever will go away.

We shall see…..

#SQLPASS Day 5 — #PathOfSQL [Dr David DeWitt]

The last day of PASS stared with a song by Rob Farley [Twitter] [BLOG] and “the cloud” Buck Woody [Twitter] [BLOG] called I should have looked the other way [VIDEO].  It was funny and fitting for SQL people.  My daughter saw it and didn’t get it.  She is 12.  SHE WILL CHANGE.

After the song was the keynote by Dr. David DeWitt on BIG DATA and Hadoop.  I have to say I never liked lectures by professors in college but these lectures are COOL [FEZ COOL].  I learned more insights on how Hadoop functions and challenges in using that technology.  Let us see what Dr. DeWitt’s team comes up with.  NOTE:  I love the old glasses.

I was fortunate enough to go to Allan Hirt’s [Twitter] [BLOG] presentation on Windows Server Core.  What I learned?  COMMAND LINE IS ……. the future🙂.

I had a chance to go to a Microsoft luncheon for people involved in their TAP program.  It was fun to sit around and chit/chat with other people who have felt my pain.  Of course all that I talked about/ate is under NDA🙂.

The next class I attended was on SQL I/O put on by SQLCAT superstars Mike Ruthruff [Twitter], Jimmy May [Twitter] and Thomas Kejser [Twitter] [BLOG].  The class was similar to what I had seen before and had some good information.  I was able to speak to Thomas afterwards on a recent blog post he had resolving PageLatch contention.  I highly respect the SQLCAT guys.

The last class I attended was put on by Sean McCown [BLOG] and it dealt with backup speeds.  This was the first time I saw Sean present in person and apart from being asked at the last minute to do this he did a good job.

I leave SQL PASS a very happy person.  My journey for this year has ended.  I hope to come back next year for more learning/adventure/fun.

#SQLPASS Day 4 — #PathOfSQL [Bob Ward]

The second official day of PASS started with another keynote address this time by Quentin Clark.  Thankfully today’s presentation was about features in SQL Server and not more marketing loveliness.  Unfortunately many of the demo’s did not use ZoomIt and they were killed for it on Twitter.  Although we do not use Azure at our company I was curious about the changes they made for SQL Azure as it relates to larger database sizes [150GB], backups [FINALLY] and auto-sharding.

I did not attend many sessions on Thursday except to see my friend Andy Leonard [Twitter] [BLOG] present on SSIS Frameworks.  NOTE:  I am a DBA and I don’t do SSIS🙂.  But Andy did a wonderful job as always.

I met a few people of significance.  First was Jen and Sean McCown [Twitter] [BLOG] and I was only the 2nd person at PASS to greet them properly.  NOTE:  I can’t use such terms in BLOG posts🙂.  Then I met Bob Ward [Twitter] and Adam Saxton [Twitter].  I highly respect both of these individuals because of how much knowledge they have about SQL Server but how personable they were.  I got to ask more questions about tempdb from Bob and he was so gracious in taking time answering.

The rest of the day was mostly a blur because of the Microsoft party I went too at FOX Sports Grill.

#SQLPASS Day 3 — #PathOfSQL [SQL Server 2012]

The 3rd day of SQL PASS began today.  Keeping with my blogging theme for the week I refer to the next 3 days as Path Of SQL.

Official SQL Server Name:  Announced at today’s keynote address by Ted Kummert was a new name for SQL “Denali”.  I had been referring to the new version as SQL 11 to match the year it would be released and the internal version of SQL Server itself. But I guess the MS Marketing people, working for months on whatever they do, were able to only come up with the name SQL Server 2012.  This makes me feel that MS will choose to release SQL Server 2012 SP1 ships on 12/25/2012 right after the world ends.  I hope to join Buck Woody in the cloud before that happens.

Hadoop Support:  MS has, in my opinion, made a smart choice to embrace open-source applications such as Hadoop and integrate it better to work with SQL Server [2012, Azure, etc].  They know what has to happen to compete in the “cloud” universe.

“Data Explorer”:  Microsoft has a new project through which they will take your data [whatever that might be] and given you recommendations.  Unfortunately the presentation was so horrible that no one in the audience was at all excited.  NOTE TO MICROSOFT:  Know your target audience.  I don’t care about ice cream or yogurt or whatever you were attempting to sell to me.

Inside TempDB:  The one class I was looking forward to more than any other was Bob Ward [Twitter] class on TempDB.  I had attended his class 2 years ago on Wait Stats and came out saying “I don’t remember anything except IT WAS AWESOME.”  So I knew this class would be 3 hours of hot coals poured onto my head and I will say “Thank you Bob may I have more?”  The best part of his class was how much work he put in to make the slides interactive, funny and full of information.  It is the highlight of the day [perhaps the week].

This week I have met many people from the SQL Server community.  To name a few: Jason Strate [SQL MVP] and his lovely wife Sarah Strate,  Jes Borland, Andy Leonard [from FarmVille :)] and Jen Stirrup [Twitter] [BLOG] today.  These guys are very down to earth and personable.  I also had a lovely NDA lunch with MS representatives.  Of course to discuss the NDA I will have to cut my head off, replace it with a robot head, blow myself up then kill you.

Let’s see what tomorrow brings.

#SQLPASS Day 2 — #WordOfSQL [aka AlwaysOn]

Continuing with my Indiana Jones theme I had the pleasure of attending Allan Hirt’s [Twitter] [BLOG] class on AlwaysOn & Denali for SQLPASS Day 2 [aka Word Of SQL].  I have known Allan since last year when he was able to answer a very simple clustering question for me in about, hmmm, let’s say 2 seconds.  It almost felt like he knew what I was going to ask but let me ask it anyway.  Since that time I have had the pleasure of being part of an NDA TAP engagement where he is also involved and I consider him the foremost expert on clustering.

We have a pretty full room for the class and I was fortunate enough to be in the front row.  Okay so I ate breakfast quickly and got there about 40 minutes before the start of the class.  A great deal of the material that Allan covered in his class was a refresher since my company has 23 Windows 2008 or 2008 R2 FCI clusters around the globe, some with 11 nodes.  So many of the issues, pet peeves or general oddities of clustering I was aware of.  Given that I still found the class all that I wanted and more.  Some situations which I can’t test [FCI to FCI clusters, multi-subnet clusters, etc] but knew about become much clearer through Allan’s presentation.  It was kind of funny when Allan would look at me from time to time in a “is that correct?” moment.

Thank you Allan for your great class.  Tomorrow is the start of PASS and Path of SQL.