Michael J. Swart

June 1, 2011

A Round-up of Round-ups and other Meta Things

Filed under: Data Cartoons,Miscelleaneous SQL,SQLServerPedia Syndication — Tags: , — Michael J. Swart @ 12:00 pm

This article is very meta.

No, I’m not talking about the friendly Mehta family a few doors down. I’m talking about the prefix Meta. In particular I’ve noticed a few SQL Blog post aggregator sites and I wanted to aggregate the aggregators, review the reviews and round up the round-ups.

But How Do I Use This Post?

I wrote this post because a friend of mine wanted to keep up with what’s new in the industry. When I showed him my list of RSS feeds, it was a bit overwhelming. So I wrote this post to be an easier and less overwhelming intro to the online SQL community. If you’re in the same boat, just follow these steps:

  1. Start by following the weekly round ups (see below). At the very beginning, it’s a very good place to start.
  2. Then if you’re still curious and your free time allows, subscribe to some of the collection feeds (see below). This gives a large variety of decent quality content.
  3. Create a category called Elite in your RSS reader and promote or tag your favorite writers to that category.

Without further ado

Weekly SQL Article Roundups

These are weekly recaps of what’s new in SQL Server are probably the highest concentration of quality links for the week. I would recommend any one of them for anyone who only has 15 to 30 minutes to spare a week but wants to keep an eye on the industry.

  • Database Weekly (website | newsletter) A weekly newsletter put on by the folks at SQL Server Central (Or Red Gate or Simple Talk; they’re all friends). It’s probably the most popular weekly round up for SQL Server and well deserved. It’s got at least a couple dozen links a week. It seems like a lot, but they’re broken out into categories so it’s manageable and very comprehensive.
  • Something For The Weekend (website | email | rss) By John Sansom (good guy). He usually has a dozen or so handpicked articles that he posts on Fridays. If you’re in the UK, he’ll also tell you about local user group events.
  • Things Brent, Jeremiah, Kendra and Tim Liked This Week (website | email) Another weekly newsletter that sprouted up about a month ago. It’s not as much of a round up as the other two in this list; It’s four people selecting three or four of their favorite links weekly. It’s only been a little over a month, but these links are cool (concentrated cool) and don’t tend to overlap with the other round-ups above.

Blog Collections

If you thought that Ulysses was a nice light read; And you remember Moby Dick as a quick fable; Maybe you’ve accidentally called the phone book a pamphlet and your favorite drink is fire-hose water. Then these are for you.

These are aggregate feeds of syndicated bloggers. Why subscribe to hundreds of SQL Bloggers separately when you can subscribe to most of them in one feed? With these feeds, you’ve got tons of articles to read and will likely not have enough time to read all of them. But if you eat\breathe\sleep SQL Server, these are for you.

  • SQLServerPedia (website | rss) Hosted by Quest software, they’ve got about 100 bloggers and I’m proud to be one of them. It’s a syndicated list which means that each article actually lives on its own bloggers’ site. But the articles are collected by SQLServerPedia’s website and rss feed. It’s a very diverse group of bloggers and together they average about 10 to 20 articles a day.
  • SQLBlog (website | rss) Run by Adam Machanic and Peter DeBetta. These blogs are popular and they’ve been around a while. They’ve got about 30-ish active bloggers under their wing and the quality is top knotch. There’s a number of things that make this site stand out.
    • Quality, You can trust the information in these articles.
    • Focus, Most of the articles are technical. Occasionally there are a few posts entitled I’ll be speaking at some user group you don’t care about. But those are easy to skip.
    • Active, The comment section is lively. Because the articles are hosted at SQL Blog, so are the comments.
  • SQLServerCentral (rss) This has a couple posts a day and includes articles from Simple Talk. The volume makes keeping up with this feed manageable. The quality of each article is first class. I believe these articles are really polished because they’re reviewed by tech editors. My only gripes are that …
    • The feed only includes a one paragraph teaser so that you have to click through to read the articles.
    • Often the teaser has no indication of who the author is. So when the teaser article is something generic like Make the most of your Database it’s tempting to simply mark-as-read.

There are lots of others and I know I’m missing a few (SQLTeam, SQLskills, SSWUG etc…) you can check them out if you’re a fire-hose water connoisseur. (Holy cow, I just spelled connoisseur correctly without spell check!!)

Michael, What Else Have You Got?

If none of the above information is new to you, good job, you’re well ahead of the curve. This post still has something new for you though, a “meta” joke (a joke about “meta”, not a joke about jokes)

The humour here is all Karen Lopez (@DataChick), I just supplied the pixels.

May 25, 2011

Another Advantage of Consultants

Filed under: Miscelleaneous SQL,SQLServerPedia Syndication — Tags: , — Michael J. Swart @ 12:00 pm

Takeaway: Veering away from technical content for a bit, I talk about the advantages of hiring an outside consultant to help with technical problems.

(I’m a full time employee and I have been since University. So when I push the advantages of hiring consultants, I’m not trying to sell anything. )

Many consultants market themselves by blogging and training. If you follow any SQL Server bloggers, there’s probably a fair number of them that are consultants. So they’re the first ones who will tell you all the reasons you can and should hire them.

But Michael Chrichton or Steven Spielberg can warn you against hiring the wrong one. Hiring the wrong consultant or contractor can prove deadly:

John Hammond's Fatal Mistake

But enough about that.

Why Do People Hire Consultants?

The Obvious

  • To solve technical problems of course!
  • You want to hire someone with expertise that you don’t currently have on staff.  (But not on a permanent basis)

The Not So Obvious

  • Having more exposure to the industry, they are in a  better position to spot things that are unusual or non-standard. They’ve got a more objective second pair of eyes.
  • They’re usually really well connected. Imagine they’re a SQL Internals expert, but you’ve got a Business Intelligence problem. They usually know how to find good help.
  • Somehow you’ve got extra budget and if you don’t spend it, your group will be punished next year with a smaller budget. (That situation always struck me as weird).
  • You’ve got an idea or solution and you know it’s the right solution. But you can’t implement it because you just don’t (yet) have the pull at your company. Consultants can be your hired clout.

The Surprising

My company recently engaged Microsoft’s CAT team to come talk to us. It’s not that there are any fires we want to put out. We’re just looking for the best way to continue grow and support our systems for the next 5 to 10 years.

I was really excited to talk to SQL Server experts for three days. To make the most of the consultation, we booked a meeting room for the entire time and got some of our most experienced people on hand to participate. We talked about lots of things, like scalability and about all the little headaches and issues that we face on a day to day basis.

Just stop there for a second. Imagine that same scenario in your workplace but now take out the consultant. What have you got now?.

You’ve got your best and most experienced people taking three days to discuss the largest headaches and issues facing your team.  THAT’S GOLD JERRY, GOLD! Now add in a consultant as a mediator and it works even smoother! It worked for us. There was actually a point during the engagement where the consultant (Hi Chuck!) was simply standing at the white board writing down pros and cons of various solutions that our team had come up with.

And when your consultant/mediator starts contributing good ideas that you haven’t thought of yet. Well that’s really really fun.

Conclusion: Consultants 1, Problems 0. Just don’t let them network your dinosaur park.

 

March 30, 2011

Something Light-hearted.

Filed under: Miscelleaneous SQL,Tongue In Cheek — Michael J. Swart @ 12:00 pm

So it’s April Fool’s day later this week and instead of trying to pull something over on folks, I thought I’d just do something light-hearted. So nothing super technical this week. Just plugged in my electric pen and …

How Most DBA Romances Start

Princess Bride spoof

SQLololo

Trololo guy

On Twitter Last Night

@MJSwart: I need one more SQL comic to draw. Ideas? (You give the idea, I give the drawing and the credit)
@BrentO: I like to think of the Resource Governor as Colonel Sanders. ;-)
@MJSwart: Done and done! Stay tuned.

… Here you go Brent
Colonel Sanders spoof

Bonus cartoon

For a nifty bonus cartoon just press F13 (This works on most browsers).

February 9, 2011

Pinal Dave: Blogger, MVP and now Interviewee

Filed under: Miscelleaneous SQL — Tags: , — Michael J. Swart @ 12:00 pm

Pinal Dave is a popular blogger and if you follow any number of blogs, you’ve most likely heard of him. Pinal Dave’s blog Journey to SQL Authority (SQLAuthority.com), has the highest traffic of any SQL Server Blogger and the third most traffic for any site dedicated to SQL Server (after SQLTeam.com and SqlServerCentral.com). Recently, Pinal was kind enough to agree to answer some questions for an interview. It’s been a fun process and I’m happy to present the results of the interview here.

Although he doesn’t know this, I’ve actually met Pinal Dave. It was at the SQL Server Summit 2009 and I was running between one session or another and I sat down to check email. Pinal was in a seat nearby talking with some colleagues of his and I recognized him. I chose not to introduce myself because he seemed busy at the time. I kind of regret that now. Some day I’ll get the chance to introduce myself in person. But meanwhile, we’ve exchanged messages through our blogs and email messages. He was good enough to submit an article on indexes when I hosted TSQL Tuesday in September last year.

I hope you enjoy this interview. I think (and hope) you’ll find it fascinating.

The Interview

You and your family

Q.Hi Pinal, Thanks for taking the time to answer these questions. First of all, how do you pronounce your name? (As you would pronounce it when introducing yourself to an English speaking Canadian.)

A. This is great question. People from India usually pronounce my name correctly. However, every time I travel internationally, I have issues. The way to pronounce my name is ‘Pinul Daway’. However, it is spelled ‘Pinal Dave’. Every time I travel to Canada, the USA or other English-speaking countries, people often call me ‘Dave’ – thinking that is my first name. However, Pinal is my first name and Dave is my last name.

Very interesting question indeed. I always wanted to clarify that on my blog but never got chance.

Q. Tell me where you grew up and where you went to school.

A. I can give you the names of the places and schools but it will not make sense. My father had a government job and he had to transfer from location to location. This meant I changed schools quite often. I cannot name one city as the place I grew up. I changed schools 12 times before I entered grade 12, I think that says it all.

Q. Tell me about your family. I believe you’re a husband and a father?

A. I have a beautiful daughter, Shaivi, and a lovely supportive wife, Nupur. Everybody has an interesting story about how they met their wife or life partner. I have interesting story about how we did not get introduced for long time.

Our homes were very close to each other. We have many common relatives and friends. But for almost 25+ years neither of us ever met each other. However, I had met her whole rest of the family (father, mother, sister, grandparents, etc) hundreds of times. Well, the same thing goes for her. She had met my family but not me. We were finally introduced to each other by our parents and it was love at first sight.

… and then there is Shaivi. She is now everything for us. This morning for the first time she said the word that I always wanted to hear – “Daddy.” I am overwhelmed with emotions.

Q. What is your favorite memory?

My top two favorite memories are already mentioned in the earlier questions.

  • The day I met my wife.
  • The day my daughter said ‘Daddy.’

I guess nothing can top those two moments.

Pinal’s blog: Journey to SQL Authority

Q. Your blog SQLAuthority.com is very popular. Why is that?

A. If I am polite and say I do not know or give you some kind of philosophy, it will not be the truth. I personally believe there are two reasons.

English – English is not my first language, which limits me to writing everything in the 500 English words I know. I think there are plenty of readers all over the world who are in the same boat as me.

Simplicity – I try to make complex subjects simple enough for even beginners to understand. We are all beginners at one point. I believe that the smartest guy is also a beginner in a new subject. I strongly believe that we all are beginners but the only difference is we all have different powers of understanding.

Q. You have written so many articles. With training and other events,when do you find time to write?

A. It is difficult – very difficult- extremely difficult! I have to ration my time. I sometimes feel guilty when I ration time away from my daughter. I promise I will not do that today.

Q. Your blog is written in English. Why is that? Do you also train in English?

A. English is my third language. The reality is that I have never received training in English. I did not formally learn English at all. I speak Gujarati (regional language) and Hindi (national language). I learned English because on the very first day I was in the USA for my master’s degree, I went to bed hungry because I did not know how to ask for vegetarian food. (I learned that I should say ‘no meat, no sea-food please’ or ‘sin carne’ in Spanish.)

Now I do training in English and I write in English. The reason I write in English is because I learned SQL in English only. I still think in my local language and then quickly translate it to English.

The reason I prefer English is because I believe English is a Global Language and if I want to help the global community, I must express myself in English.

Q. Who has helped you the most with your successes? How have they helped?

A. As this question is in a SQLAuthority.com section I understand you are asking this question in a professional aspect.

I have four icons:

  1. Ben Forta – He is an Adobe Evangelist and I learned a lot reading his blog and books in my early career. I always wanted to be Evangelist like him. I think I want to give him complete credit for inspiring me to write a technical blog.
  2. Vinod Kumar – He is an MCT-Technology Specialist in Bangalore, India. He was an SQL Server Evangelist from the inception of the program in India. After coming back to India, I read his blog and always wanted to be like him – helping the community become more technology aware.
  3. Rushabh Mehta – He is Solid Quality India CEO and world famous BI expert. He is one man, who have given me chance – chance to prove myself, chance to grow, chance to learn technology, chance to help community, chance to go to next level and many more. I own a lot to him.
  4. Rajendra Dave – He is my father. He reads each of my blogs and gives me his feedback. He always encourages me to write creatively and constructively. He has one rule – “Praise in public, criticize in private.” I think this has helped me tremendously. Others have inspired me but he has put 100% of his efforts in making me successful.

Q. You mention on your blog that you’ve been awarded the MVP award. How long have you held that distinction and how did it feel when you first won it?

A. The MVP was the best thing in my life professionally. The feeling was that Microsoft is watching me and appreciating me. I felt – “Microsoft Cares.” It was great feeling. I have been holding this award for three years continuously. I think being an MVP is the best thing that can happen when one is dedicated to the community.

The MVP award has enabled me to do lots of things. It has connected me with great peers and given me access to essential resources, which enabled me to help community further.

Q. Besides blogging, consulting, training and family time, how else do you spend your time?

A. I like to travel. I travel for consulting, training, the community, and for family vacations. Due to the nature of the job, I have to make a conscious effort to stay away from work many times. When I travel with my family, I make sure I do not keep computers around. I do not even check my email and spend 100% time dedicated to my family. They love it and I love them.

Thanks Pinal

Thank you again Pinal, I’m grateful that you took the time to answer my questions.

November 22, 2010

This Day In History

Filed under: Miscelleaneous SQL — Michael J. Swart @ 9:28 am

Happy Birthday Dave

A birthday cakeSo it’s mine and my brother’s birthday today and although he’s not a SQL Server professional, he’s still got an online presence. Dave’s hobby (and career I guess) have to do with images and computers and pictures made amazing and nifty by computers.

He posts all of his stuff (or almost all of it) on flickr. And if you like nerdy/nifty things check out his list of favorites.

If you look at his stuff, and you have a flickr account, I strongly recommend commenting on a picture of his. I think a thoughtful comment on a picture that you like would be the best present.

And speaking of “present” (see what I just did there?) If you want to see him present, here he is giving a 5 minute lightning talk on the visual sphere. It’s very much like my own presentations, although his talks are generally more interesting than mine: http://www.youtube.com/watch?v=KppatojPM_0

My Favorite Blog Posts

Me, I’m following his lead and I created a new page that lists my favorites and your favorites. I want to make it easy for new readers or lurkers to get a sense of what my blog is about by putting my best foot forward.

September 24, 2010

How Would You Explain Your Job to Someone in 1950?

Filed under: Miscelleaneous SQL — Michael J. Swart @ 11:40 am

So I was talking with a friend of mine, Dariusz Grabka (blog | twitter). We were talking about what careers we would have if we had lived during different times in history. I realized that our careers today are so specialized that not only did they not exist 50 years ago, but they probably couldn’t be explained very easily to someone 50 years ago.

But it’s a fun exercise. Here’s my take on explaining my job to someone from 1950.

So I spent some time imagining myself in my grandfather’s shoes circa 1950 and what kind of context he would need to understand the job I have now. I explain the I.T. industry and then mention my part in it:

My Job

ME:
So there’s this computing machine called a computer that can be used to perform all sorts of calculations (There’s one the military uses outside of Baltimore called the ENIAC).

In 2010, these computers are so inexpensive and small that these machines are used everywhere. And they’re so powerful that they’re being used as communication tools for all sorts of information or data.

So there is a large demand to store all this data. I mean there’s thousands of LIBRARIES worth of information to store. And it can all be stored on something the size of a small brick!

Frequently, this information has to be organized so that it can be located and read. We organize the data using different techniques and we call this collection of information a database.

My job is to organize the data so that storing and retrieving the correct data is done efficiently.

Fellow From 1950: So, you’e like a librarian for computing machines?

Me: Exactly!

May 4, 2010

So let’s talk…

Filed under: Miscelleaneous SQL — Michael J. Swart @ 5:52 pm

Hey you! Yeah YOU! The you that’s reading this very text, I need you to do me a favor!
I’m collecting information for a blog post I’m in the middle of writing. I don’t want to spill the beans yet, but if you could take the time to answer the following questions, I’d appreciate it!

December 16, 2009

Gleeful Calamity

Filed under: Miscelleaneous SQL,SQLServerPedia Syndication — Michael J. Swart @ 11:21 am
Uhhh Ooooo

Uhhh Ooooo

“Gleeful Calamity”

… is a phrase that I’ve been giving thoughts to for the past few days. I’m quoting a phrase that Gever Tulley used in a TED talk he gave about his tinkering school.

In many situations it’s valuable to have the freedom to fail. Especially when the goal is learning.

When learning new things about SQL Server, I couldn’t take in half as much knowledge if I didn’t have a development server called sandbox. The sandbox db sits on my local machine. And like its namesake, it’s a safe place to play. It’s a place where starting from scratch from time to time is normal and expected. I expect that the tempdb fills this role for many of you.

Being Creative (Idea Mash-ups)

Having the freedom to fail is also valuable when you want to be creative. Later on in this post I’ll explain a failure of mine and I’ll go through what went wrong and why it doesn’t matter.

Being creative often entails tweaking an existing idea or taking two separate ideas and putting them together.

Sometimes the Idea Mash-ups Work…

… and Sometimes They Don’t

Here’s one failed idea I had.  A long time ago, I work with a database that had 800 tables in one schema in one database. By comparison, the Adventureworks database has about 70 tables in five schemas. I asked myself. Is there an automatic way to group the tables into candidate schemas while staying agnostic about the business rules? Here was my thinking:

  • I can infer table relationships using defined foreign keys, sys.sysdepends and other clues based on the naming conventions we used.
  • Tables and their relationships remind me of vertices and edges in graph theory.
  • I can rely on theories of dead mathematicians to do my work for me!

… in theory any way. In practice – as I found out – there’s no substitute for digging into the business rules of a domain, sigh. But the process was fun and didn’t take too much time. While I was investigating this idea, I thought this is what creativity feels like.

Meta-Calamity

When I started writing this post, I had a different example of a personal failure in mind:

In my sandbox, I once explored a (seemingly) novel idea and after a while, I decided it sucked. As it turns out, Google tells me that my idea was not so novel after all and was written up in a blog as a good idea by someone I respect. So for that and other reasons, I picked another failure. Lesson: Google seemingly novel ideas before beginning a blog topic about it.

(Image is courtesy of Anthony Cain on Flickr… Check out his photostream!)

December 1, 2009

Comparison: Switching Tables vs. sp_rename

Filed under: Miscelleaneous SQL,SQLServerPedia Syndication — Tags: , , , — Michael J. Swart @ 1:00 am

Takeaway: Stick with sp_rename and leave the ALTER TABLE SWITCH statement for partitions.

Earlier in the month I was at a talk given by Don Vilen called To Partition or Not To Partition The questions .. and the answers. In the talk he gave an interesting tip about switching partitions. (Remember that switching partitions is a method that is used to implement the sliding window strategy. For more info, search for the keyword SWITCH in this page).

Here’s the tip: Notice that the partition arguments in the ALTER TABLE – SWITCH command are optional. This means that you can swap the data of any table with another. It doesn’t have to be partitioned. But that staging table must still be empty.

So as I thought about how to get around the empty staging table restriction, I had an idea (Great Scott!) This is the diagram I made in my notes:

Not a flux capacitor

Not a flux capacitor

Moments later, Don Vilen summed up this idea: “The staging table must be empty. But there’s nothing stopping you from taking a third table with data and switching that into the newly emptied table.” I’m paraphrasing. He said it much better than that. Maybe an example would help:

use tempdb;
 
create table primary_table (i int primary key);
create table staging_table_with_data (i int primary key);
create table empty_staging_table (i int primary key);
insert primary_table values (1), (2), (3)
insert staging_table_with_data values (4), (5), (6)
 
-- the following does not work:
alter table primary_table switch to staging_table_with_data;
/* this fails with:
    ALTER TABLE SWITCH statement failed. The target table
    'tempdb.dbo.staging_table_with_data' must be empty.
*/
 
-- but this does work:
alter table primary_table switch to empty_staging_table;
alter table staging_table_with_data switch to primary_table;

When would you use this?

The original reason that the SWITCH statement was implemented was to help transfer data efficiently by using partition switching. But I think we can use this feature on whole non-partitioned tables in order to quickly transform data.

A great example is an update statement that applies to a large number of rows that has to be done quickly. Myself, I’ve come across a situation where we were converting local times to UTC times and needed speed.

Is this any better than sp_rename?

In the domain of non-partitioned tables, the answer is no, not at all. In fact the code above can probably be written like this:

use tempdb;
 
create table primary_table (i int primary key);
create table staging_table (i int primary key);
 
insert primary_table values (1), (2), (3)
insert staging_table values (4), (5), (6)
 
exec sp_rename @objname='primary_table', @newname = 'old_data', @objtype = 'OBJECT'
exec sp_rename @objname='staging_table', @newname = 'primary_table', @objtype = 'OBJECT'

You probably have seen this kind of technique used by tools that generate scripts to change table definitions. In fact this is the only technique you can use to add or remove an identity column to a table.

So then what’s the difference between them? Why would you choose one method over the other. Hopefully you can use the rest of the article to make an informed decision.

Restrictions

When renaming tables using sp_rename, there are very few restrictions, in fact I’m pretty sure there are only four:

  • Neither the primary or staging table can be temporary
  • The table can’t be published (via replication)
  • The new name can’t clash with an existing object name.
  • Enforced dependencies – like schema-bound views - can’t exist.

In fact, aside from syntax errors, I’ve never ever seen sp_rename fail. However, when swapping non-partitioned tables using the SWITCH keyword there are more pitfalls to watch out for:

  • The columns, types, indexes and constraints of the primary and staging tables must match.
  • too many others to list

To see what could go wrong, read the manual here or check out the error list with:

--roughly 50 rows here:
select text from sys.messages
where text like '%ALTER TABLE SWITCH statement%'
and text not like '%partition%'

But the the best approach would be to test specific scenarios on a test machine. Just to find out what’s possible.

Benefits of one over the other

So if you’re still with me (and congratulations and thank you for bearing with me) you might get the distinct impression that sp_rename is the better choice. You’re probably right. But I’ll still try to sum up the benefits and drawbacks of each method here:

sp_rename:

  • Almost never fails.
  • Different table definitions are possible.
  • Indexed views (which rely on schema-bound views) are not allowed.
  • Foreign keys and indexes must be recreated before or after the rename.

SWITCH

  • You don’t have to recreate indexed views. But the staging table must have matching views before the switch.
  • Other foreign keys, indexes and constraints do not need to be redefined. But as before, the staging table must be prepared properly.
  • Minimal or zero downtime.
  • The big drawback is the rule that requires the staging and the primary tables to have matching definitions.

So, like I said in the beginning: For the most part, stick with sp_rename and leave the ALTER TABLE SWITCH statement for partitions.

November 17, 2009

Welcome to the new site!

Filed under: Miscelleaneous SQL,SQLServerPedia Syndication — Michael J. Swart @ 2:32 pm

I’ve moved!

www.MichaelJSwart.com is live!

I’ve given up the blogger/blogspot site and moved into some fancier WordPress site. Hosted here at MichaelJSwart.com. There might be a few hiccups as I continue to smooth things out. So check the place out. Tell me what you think. Leave a comment as a housewarming present.

RSS Feeds

You do not need to adjust your RSS feeds! If you are reading this in your feed aggregator that means you will continue to receive all the high quality blog posts you’ve come to expect from yours truly (cough cough). If you’re reading this from the website itself, consider subscribing.

A big big thanks to Brent Ozar for helping me set this up.

Michael J. Swart

« Newer PostsOlder Posts »

Powered by WordPress