Archive for the ‘ musings ’ Category

Re-Post: SQL Server and PowerShell WebCasts

I created a 2 part webcast on SQL Server and PowerShell last November/December, and I just wanted to re-post it in my site.

SQL Server PowerShell: Part I

Posted on November 25, 2009

Overview: This video is part 1 of a 2 part video series that goes through PowerShell basics with demonstrations on how to use PowerShell with SQL Server.

SQL Powershell Part One authored by Donabel Santos (@sqlbelle) on Vimeo.

Author: @sqlbelle

Recorded On: 17″ MacBook Pro

Software: Telestream’s ScreenFlow

SQL Server PowerShell: Part II

Posted on December 3, 2009

Overview: This video is part 2 of a 2 part video series that demonstrates how to use PowerShell with SQL Server, using the SSMS built-in mini shell, and using .NET and SMO.

SQL Powershell Part Two Donabel Santos (@sqlbelle) on Vimeo.

Created for the Edmonton PASS user group by Donabel Santos at Black Ninja Software.

Author: @sqlbelle
Recorded On: 17″ MacBook Pro
Software: Telestream’s ScreenFlow

VN:F [1.4.0_681]
Rating: 9.5/10 (2 votes cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

Refactor This: Runaway T-SQL to Print YYMMDD

Recently trying to debug some really cryptic T-SQL scripts.

Guess what this is trying to do?


--

DECLARE @dt varchar(6)
SET @dt = RIGHT(CONVERT(varchar(4), YEAR(getdate())),2) + REPLICATE('0', 2 - LEN(CONVERT(varchar(2), MONTH(getdate())))) + CONVERT(varchar(2), MONTH(getdate())) + REPLICATE('0', 2 - LEN(CONVERT(varchar(2), DAY(getdate())))) + CONVERT(varchar(2), DAY(getdate()))

--

Answer:

It’s trying to print the current date in YYMMDD format.

Uhm, there’s a much better way to do this.

Try CONVERT.

--

SET @dt =  CONVERT(VARCHAR(6), GETDATE(), 12)

--

I still quite enjoy debugging or refactoring T-SQL scripts, but sometimes I’m just amazed at what I still see …

VN:F [1.4.0_681]
Rating: 9.8/10 (6 votes cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

Becoming a DBA – the Right and Not-So-Right Reasons

“Choose a job you love, and you will never have to work a day in your life”. – Confucius

It’s amazing how many, and how consistently, I get “reluctant would-be DBAs” in my class. I always do a quick survey or poll when the course starts where I ask the students why they’re taking the class. My classes are part time studies courses, and usually taken by students who are already working and just doing continuous learning, or are making a career change.

I’ve seen different types of reluctant DBAs:

  • Some of the students do say they were “forced” to take the class by their bosses, because they need it for their corporate professional development program.
  • Other students have other job titles (PMs, data entry clerks, accountants, marketing managers), but are taking the course because they were recently assigned the title “DBA” — because they happened to know a little bit more about the data or the system than anybody else in the company.
  • Still other students truthfully admit they want to become DBAs because they heard it’s a stable and secure job, and that’s what they want even though they have no interest whatsoever with databases.

When they ask me “How do you become a DBA?”, I answer them with another question “Do you like working with databases?”

If they say “Yes”, then I go all gung ho, and share all my RSS feeds and twitter people I follow, and articles I’ve read and written. Then I’ll talk their ears out on how I love working with databases too – SQL Server specifically.

If they answer “I don’t know” .. then I think there’s a potential there to start liking databases more as they work on it more. Which is a good thing. That’s when I start encouraging them to learn more about it, refer them to BCIT’s elibrary (Books 24X7) for additional ebooks, Brent Ozar’s site, SQLServerPedia and Brad McGehee’s book “How to Become an Exceptional DBA”

When they answer “I don’t” or “Absolutely hate it” but they’re there for the title or the job security (what job security? is there such a thing?), that’s when I start rambling that they should try to figure out what they want to do, and that they shouldn’t be in it just because they think it’s a “stable” job, or somebody said “you should be one”.

As with any other profession, becoming a DBA almost has to be a calling. It’s either you like (better yet, LOVE) working with databases, or you don’t.

I don’t discount the fact that you can learn to love working with databases. Take Jorge Sergarra (@sqlchicken) – he mentioned in his addendum to his “3 things post” that

“…One thing I forgot to mention in my post is that in college I HATED the database class. I was almost reduced to tears because I couldn’t figure out who to create a proper stored procedure. It’s funny, years later, that I absolutely love all things database! …”

If after trying the DBA field for some time, and you’re quite sure you’re not enjoying the work, you should get out and find your calling. Don’t choose to be “imprisoned” in a field you don’t want to be in. You’d want to be in a field where you come to work all excited and giddy about what you’re going to do for the day, what new things you’re going to learn, and what impact your work is going to make for the company or people you’re working for.

VN:F [1.4.0_681]
Rating: 9.5/10 (10 votes cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

I’ve been tagged – Three Things That Got Me Here

Glenn Alan Berry (@GlennAlanBerry) tagged me, so here goes my version of “3 things that got me here” …

I wanted a job that didn’t involve hiking up the mountains in winter …

I took Geology in University (while working almost full time closing shifts at a local McDonald’s), spent a lot of years trying to get the degree and learning all about rocks and palaeontology and plate tectonics and petrology, but realized it was not for me. How did I know? First, Im not really the sporty athletic type. So hiking up the mountains was not that appealing to me.

In University, we had to do a field work up one of the mountains here in British Columbia in the dead middle of winter, that’s when I realized working in really high up cold snowy environments just does not sit well with me. As soon as our field work was done, I went back to University, dropped all my Geology courses, and took an MIS (management information systems) course – because my perception was MIS courses didnt involve hiking-up-the-mountain-in-winter.

What I didn’t really realize was that taking MIS meant I had to use a computer, a statistics application (I think it’s called JMP), and Excel.

And boy did computers and Excel ever scare me. I remember going home one time crying to my brother, because I cannot wrap my head around the exercise we did that day. I had to put some data in some of the columns, and they had to automatically add up. I just didn’t get it. How did that happen? Was that some kind of witchcraft?

I ended up just barely passing that course, leaving University, and tried starting again … by going to BCIT. People said it’s the “institute that gets you a job”. And yeah, I wanted one of those ..

BCIT rejected me, but I still went anyway .. and there I met Elsie …

I wanted to go to BCIT to do a computer programming course, which is ironic because I really was scared of computers (yes, scared. At that time I was a new immigrant, and the high school and University I attended prior to immigrating barely had anything computer-related). BCIT turned me away though because I did not have any programming background, that apparently Canadian high school students should have.

Rejected and dejected but still not giving up, I tried to go to another local college to do my computer programming pre-requisites. I went to CompuCollege (now called CDI College) to do computer programming. I was lucky to have an instructor who was so passionate about programming, that I ended up enjoying working with computers and programming. I graduated from CompuCollege with honours, and went back to BCIT. Yes I still wanted to have that BCIT Diploma.

Despite having a computer programming diploma in my belt, BCIT still proved to be very challenging. I spent two (2) years of sleepless nights finishing up tons of assignments, crazy number of projects, and just piles and piles of quizzes and exams. But it paid off in the end. I finished Client/Server Option with honours.

After graduating from the Diploma program, I had the urge to pursue the Bachelor’s Degree, and I did. It proved to be one of the best decisions I ever made. I started doing TA work for the instructors, got introduced to the Operations Manager for School of Computing PTS (which started my teaching career at BCIT – 8 years and going!), met and worked with the Dean and Associate Dean at that time, and also got to know Elsie.

Elsie was the program head for the Database Option for the BTech, which I was part of. I admired her so much and her knowledge and passion about databases really got to me. She had us working with a whole slew of DBMSs (Oracle, SQL Server, MySQL, Object Relational databases etc). I think that’s how I started really becoming curious about databases. I did well in my courses, and got a job as IT Manager even before I finished my degree.

I used to be an open source gal …

I started as an all around IT person for a small IT company which use mostly Open Source products – doing networking with Linux/PCs, developing applications using VB/C/C++/J2ME, develop tons of web applications using HTML/CSS/JavaScript/PHP and Perl (I even tried Zope and Python!), and manage the company MySQL database. I learned so much from this experience, but I have to tell you that as good as MySQL is at that time, there still were so many limitations that I found quite frustrating. At that time, the version we used did not support subqueries and stored procedures – which made my scripts a lot more complicated than it needed to be.

I also had to create a lot of reports (yup, similar to what you see in SSRS). Have you tried creating reports with Perl, bare GDI and other open source packages? I have. And it was painful.

Ever tried doing the same exact thing using reporting services? I have. And it was the complete opposite of painful. That’s when I decided that I really would love to work more with SQL Server.

When it was time for me to look for another job, I actively pursued jobs that used SQL Server, and other Microsoft products. I got hired as a SharePoint and SQL Server consultant, and my affair with SQL Server continued to flourish. I pursued SQL Server consulting gigs (report writing, script writing, tuning queries, administration), and went on to become a DBA for a big publishing/advertising firm (24X7X365) and part time DBA for an online ticketing system, and then as a consultant again for Black Ninja Software, where I head any SQL Server-related projects, training and contracts.

All this time I also remained active in teaching at BCIT, and as much as I can, I’ve tried help my students out in with their SQL Server related challenges in their day jobs. I still get emails from students I’ve had five or six years ago asking for advise on some things.

I also became more active with the community, having volunteered to speak at VANPASS, VANTUG, Victoria Users Group and DevTeach. Started blogging more, tweeting more, and just getting to know more really smart and helpful SQL Server folks out there .. and now also helping out Scott Stauffer (@sqlsocialite) in running VANPASSBI.

Now it’s your turn…

That’s my story, now I would love to hear your stories, so Im tagging :

Jorge Sergarra (@sqlchicken), Mladen Prajdic(@MladenPrajdic) and Josef Richberg (@sqlrunner)

here’s an old bio I have from BCIT
Donabel Santos (@sqlbelle) old bio

VN:F [1.4.0_681]
Rating: 10.0/10 (6 votes cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

This is my SQLPASS :

Sessions

Day 0 – Pre-Conference

  • Building a Microsoft Data Warehousing Platform by Brian Knight – excellent introduction to data cleansing, warehousing, and even data mining!

Day 1

  • Keynote
  • Spotlight: SSRS in the Enterprise – How to Survive with a Smile (Wayne Snyder)
  • To Partition or Not To Partition – The Questions … and the answers (Don Vilen)
  • SQL Server Execution Plans from Compilation to Caching to Reuse (Maciej Pilecki)
  • Designing and Building Private SQL Server Clouds

Day 2

  • Quest Software Breakfast Presentation about DMVs (Kevin Kline – @kekline, Brent Ozar – @brento, Tim Ford @sqlagentman, Buck Woody @buckwoody, Louis Davidson @drsql) – Wish there was another Quest breakfast for tomorrow
  • Keynote
  • Applied SSIS Design Patterns (Andy Leonard @AndyLeonard)
  • DRP101: Learn the Difference Between Your Log and Your Cluster (Brent Ozar @brento)
  • Women in Technology Luncheon sponsored by CA
  • Adding SSRS Report Bells and Whistles (Jessica Moss @jessicamoss)
  • Security and Deployment with Reporting Services 2008 R2 (Lukasz Pawlowski)

Day 3

  • Keynote
  • and highlight of the week: got invited to the bloggers table! Thanks Grant (Grant Fritchey – @GFritchey) and Brent (Brent Ozar – @brento)
  • said hi to Peter de Betta (@debettap)
  • Advanced Techniques for SSIS Package Development (David Noor)
  • Super Reports:Patterns and Recipes (Paul Turley) — and at the same time watching hilarious tweets from the @buckwoody comedy hour .. err session
  • SQLCAT: SharePoint on SQL Server – Implementation, Configuration and Tuning (Burzin Patel) — and still watching back and forth hilarious tweets from the @buckwoody comedy hour .. err session
  • Storage for the DBA (Denny Cherry @mrdenny)

Last Day – Post-Conference

  • with Itzik Ben-Gan on Query Tuning and Indexing for SQL Server 2005 and 2008 (Grant did warn that “bleeding in the ears” is normal, and I have to say, he wasn’t kidding!)

There are many sessions I would have wanted to attend, but they all happened at the same time. Which justifies why Im getting the DVD :) And – all of the presentations have been great!

Inspiration

Additional highlights of my first SQLPASS:

  • I mentioned it already, but again worth mentioning – highlight of the week: got invited to the bloggers table! Thanks Grant (Grant Fritchey – @GFritchey) and Brent (Brent Ozar – @brento)
  • Kevin Kline (@kekline) remembering my name! :) (his first recollection was “ninja.. you’re with the ninjas…”
  • Quest Software Breakfast Presentation was great
  • Women in Technology Luncheon was (is) very inspiring

SQLPASS Twitter Connection

And, even if this is the first SQLPASS I attended, I think it has been one of the coolest so far (based on remarks I heard). Bloggers and “tweeps” have made their mark in this conference. And some of “tweeps” I have met so far… (the pleasure and privilege is mine!) ~ I’m @sqlbelle

  • @brento
  • @kekline
  • @GFritchey
  • @brianknight
  • @AndyLeonard
  • @wendy_dance
  • @sqlfool
  • @pinaldave
  • @joewebb
  • @bknight
  • @peshkaj
  • @stuarta
  • @lotsahelp
  • @sqldba
  • @paschott
  • @mike_walsh
  • @DamonRipper
  • @SQLDBA_Dude
  • @SQLSocialite
  • @GlennAlanBerry
  • @llangit
  • @SQLServerMag

It is very inspiring to meet a lot of these people. If you meet them, you’ll know right away how passionate they are about their craft, about learning, about their dedication to share their knowledge and help others. It is very humbling.

Swags

And .. thanks to the vendors for the swags :)

  • Quest – for the free signed Database Benchmarking book (thanks Kevin Kline!) – plus the twitter shirt!
  • Red Gate for the free books on Exceptional DBA and DBA Tacklebox
  • Idera – I got to spin twice .. got a $1 and a cup holder. But it was good to see our buddy David Terry!

Lessons Learned

Aaron Bertrand mentioned in his post Another PASS has come and gone – “If you didn’t make it to PASS this year, I feel bad for you.” ~ in some ways I do too.

We have our own reasons for not being able to attend conferences such as SQLPASS, but after attending my first PASS, I realize now how much I have been missing. I feel I’ve gotten SO MUCH out of this year’s SQLPASS conference (networking, learning, just being able to feel “at home” in the company of people who love the same technologies and work you love), and I will try every way I can to ensure I attend again next year – SQLPASS2010.

One (1) day Post-PASS

  • missing the #sqlpass tweets
  • volunteered for VANPASS
  • Started reading Lynn Langit’s Smart Business Intelligence Solutions and SQL Server MVP Deep Dives
  • Itzik Ben-Gan, I just ordered your books! That was how awesome I thought the sessions were

PS – I will be sharing some tips/tricks/enlightenments I’ve learned in the next few blogs

VN:F [1.4.0_681]
Rating: 8.0/10 (1 vote cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

Are Vendor Certifications Still Valuable?

Are they?

I personally find them still valuable. Poured my thoughts into our company blog :
Black Ninja Software – Are Vendor Certifications Still Valuable?

How about you? What’s your take on it?

VN:F [1.4.0_681]
Rating: 6.8/10 (4 votes cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

Steve Jobs and the Drainei

my two new desk buddies. interesting pair they are – steve jobs and the drainei.
:D

steve jobs and the draenei
VN:F [1.4.0_681]
Rating: 8.0/10 (1 vote cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis

Have You Downloaded the Free MS Press SQL Server 2008 Ebook Yet?

… written by one of our cool DevTeach speakers Peter de Betta?

Yup, it’s a free MS Press Ebook on SQL Server 2008. What else can we SQL Server junkies ask for? (Ok, fine I said that too soon, there’s probably still a fair bit of stuff we want out of SQL Server).

Anyway, this is the link to Peter’s blog about the book :
http://sqlblog.com/blogs/peter_debetta/archive/2008/09/16/introducing-sql-server-2008-the-book.aspx

This is the excerpt:

To get your free copy, browse to http://www.microsoft.com/learning/sql/2008/default.mspx. From there, look in the Special Offers section for the “Free e-book offer“. Although the site states you can get excerpts, the whole book is available for reading.

Coolio?

VN:F [1.4.0_681]
Rating: 10.0/10 (1 vote cast)
Share :
  • Digg
  • del.icio.us
  • Google
  • description
  • StumbleUpon
  • Technorati
  • TwitThis
`