March 2009
Mon Tue Wed Thu Fri Sat Sun
« Feb   Apr »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Month March 2009

Dynamic SQL Presentation Materials

First off, thanks to everyone who attended today’s Dynamic SQL presentation. I appreciate everyone taking the time out of their busy day to attend the first AppDev SIG Live Meeting in quite some time. Hopefully there will be many more.

I’ve attached a copy of the Dynamic SQL presentation that I gave today. Here’s a run down of the contents of the zip file and an explanation of the database setup:

  • The DynamicSQL database referenced in the SQL is a copy of the AdventureWorks 2005 database renamed to DynamicSQL.
  • A copy of the dbo.Customers table has been imported from the Northwind database.
  • The Dynamic T-SQL Support.sql file contains SQL to create a calendar table and a numbers table that are used in the example SQL as well as the Helper_LongPrint stored procedure that is used to help debug longer stored procedures.
  • The Dynamic T-SQL.sql file contains the example SQL used in the presentation as demo code.
  • QueryStress1.sqlstress and QueryStress2.sqlstress contain the settings for the two SQL Query Stress demonstrations that were shown. QueryStress1 shows a positive baseline for using parameterized SQL whereas QueryStress2 shows a less performant option using a query build in an ad hoc fasion.

If you have any questions, feel free to email me at jeremiah.peschka@gmail.com.

Dyanmic SQL Presentation Tomorrow – March 31

Just a quick reminder that I will be presenting on Dynamic SQL tomorrow at 1pm EST for the PASS AppDev SIG. Details are available in my previous post. Hope to see you all there.

Meet and Code – Weekend in Review

I spent my weekend in my company’s office. Keep in mind that 1) I’m a consultant and I’m usually at a client and 2) I didn’t get paid. Why would I spend my weekend at work? Meet and Code

What’s the point of Meet and Code? The point is for a bunch of people (developers, DBAs, UI people, PMs, BAs, etc) to get togther and work on a project to learn, build new skills, and do it right the first time. Sometimes, the real world constraints of deadlines and budgets don’t always give us the time to do TDD and to do things properly. So we rush through things and have to test manually. Not at Meet and Code. Instead, we’re doing things using agile practices, TDD, and rapid development techniques so that we can practice the craft that we preach about.

See, a few months ago someone had the crazy idea that we should get together and work on a software project over the weekend. Now, that catch was that we had to recruit other people. So, we recruited other co-workers. Eventually we’re planning on recruiting the rest of you, but bear with me.

After we recruited a team of suckers volunteers, we did a few planning meetings before everything got started and decided on a product to work on (an event RSVP web application so we could manage the next time we do this). We also figured that everything would take about a weekend (Friday 5pm – Sunday 5pm).

Friday was pretty much a wash. There was a TDD and mocking demonstration that was incredibly helpful, especially since I haven’t done TDD in a long time and mocking is just right outside of my area of expertise. Most people didn’t have development environments set up on their computers, there was some confusion about who was responsible for determining what, but things got ironed out by the end of the night. Towards the end of the night, I started working on the database and the UI people were able to get started. I left around 12:30 or so. Things were pretty disorganized, but it was a good start.

We finally got a build server set up early Saturday morning. I kept churning out database code while the business layer was being put together. There was still a bit of confusion, but by the end of the day things were going full steam. People came and went, but that’s what we expected.

The office was pretty humid and smelled distinctly of feet by the end of the night. It didn’t help that the air conditioning is turned off on the weekends.

By Sunday, I was starting to run out of steam. It’s tough to make it through a week of your day job and then run through a development sprint on the weekend, but the fun and learning made it more than worth it.

How did it turn out?

It went well. There were definitely some initial teething problems – development environtments weren’t set up, use cases weren’t fully fleshed out – but we made it through them.

Going forward there are definitely some things that we could do differently to make things run smoother:

  • Install fest – We should have held an early install night where we focus on getting everyone’s development environment prepared. This would prevent problems with service packs installing and getting different versions updated.
  • Training materials/demo – In addition to the install night, having fully built a single feature to demonstrate the ‘proper’ way to use ASP.NET MVC would have been very helpful for everyone.
  • Dedicated user representation – We initially had some BAs present on Friday night, but they had other weekend plans. It was difficult at times to resolve some ambiguity in the use cases or to determine how a feature should really function. If someone else was designated as the user representative, we would have been able to defer to the user rep on all of these issues.

However, despite these teething problems, we had a lot of fun and I definitely think we’ll be repeating this a few more times before we take it completely public with some hints and tips on our methodology for running the event smoothly.

Links for the Week 2009-03-27

SQL Server

Database Manager for IIS 7 RC Preview IIS 7 has a lot of great features built-in, not the least of which is its ability to host mini-apps. Ever use PHPMySQLAdmin? Ever wish you had a tool like that for SQL Server? Now you do. Developers rejoice, you no longer need to install SSMS after Visual Studio installs a copy of SQL Server that you can only access programmatically.

Database Maintenance Best Practices Part II – Setting FILLFACTOR Ever want to know more about FILLFACTOR than you ever thought you wanted to know? Kim Tripp takes a look into an oft overlooked aspect of index and database design/tuning. I now know more about FILLFACTOR than I thought there was to know.

Dev, Test and Production SQL Server environments Ever wonder what smart people think about how to dest up a dev, test, and production SQL Server environment? Brent Ozar goes over his ideas and best practices for a SQL Server environment based on years of tried and true experience.

Development

Mega drop-down navigation at Basecamp and Rails Guides site While this isn’t exactly development related, it’s web development, which is close enough in my book. UI styling is very important – it influences how the users interact with your application and, most importantly, how they perceive and interact with the underlying data. Make this action easier and painless and the users will be much happier (trust me).

Visual Studio Addins – SmartPaster and CopySourceAsHTML Ever want to paste in text as code documentation? How about as a #region in your C#? Ever want to export that method as highlighted HTML? Well, now you can do that easily!

Stuff & Things

Logon Changer Customizes the Windows 7 Login Screen Want to pretty up your Windows 7 machine with a custom login screen? DO IT!

Extreme Sheep LED Art Special thanks to William Gibson for bringin

Presenting on March 31

On March 31st at 1PM EST, that’s 10AM to those of you on the West Coast, I will be giving my presentation Dynamic SQL: What’s all the fuss about, anyway? via Live Meeting, courtesy of the Application Development SIG. The presentation will last for approximately 1 hour. Here’s a bit more info to get you all kinds of excited about it:

Dynamic SQL is a powerful but difficult tool to master. Jeremiah will show you techniques for creating rock solid, fast, dynamic SQL that will meet the day to day needs of your production system.

Live Meeting URL: https://www.livemeeting.com/cc/usergroups/join?id=JP2R3Q&role=attend
Audio Dial-In Information:
Toll free: +1 (866) 379-8990
Participant code: 6489756

This is Why Backups Are Important, People!

Every time you do something major to the database, you need to create a backup. Repeat that three times. Then a few more times. Then do what I did and completely forget to follow the rules.

Our production environment consists of a master database that is replicated to multiple servers. There are non-replicated tables that we need to backup on a routine basis since the replicated data can easily be recovered in the event of a catastrophic failure but this other data would just disappear into the ether. Solution: move it to a new file group. Easy, right?

I created a nice little script with the help of SSMS to move all of the tables to a specially prepared file group. Somewhere in the process, I ended up getting sick. I completed my scripts and went home and left it to our migration person to move into production. It turns out that something failed in the script. Somehow temp tables that were supposed to contain the data were not present. All of the unreplicated tables were not only not in the correct file group, they were also completely empty.

So, what’s the solution here? Mexico. Well, you pick up the phone, call your boss, and in the calmest voice possible you explain exactly what happened and own up to your mistake.

Why do you do this? Because it’s better to own up to a mistake and potentially get your head shoved into a toilet than it is to try to cover up your mistake. Covering up your mistake just makes you look shifty and untrustworthy. People don’t want to think of their DBA as shifty and untrustworthy. Eventually, everyone is going to remember that when your professional reputation and potentially your job (depending on severity) was on the line that you held your head up high and said ‘I completely forgot to take that backup and blew away our data with a bunk script.’ Hopefully what they’ll remember is the fact that you had the integrity to stand up and be honest, not that you completely nuked half the database.

Upcoming PASS AppDev SIG Presentation

On March 31st, at 1 PM EST, I will be giving a presentation via Windows LiveMeeting for the PASS AppDev SIG. I know the next question on your mind, it’s probably “When are you going to shut up?” “Jeremiah, pray tell, what is the topic of this delightful and amazing presentation?” Well, folks, when you tune in on March 31st you be treated to my presentation, which is titled: Dynamic SQL: What’s all the fuss about, anyway?

As soon as I have LiveMeeting info, I will post it here and make sure an announcement gets out to the public.

If you’re interested in becoming a part of the AppDev SIG get in touch with Todd Robinson, his contact info is on the SIG’s web page, and ask for more information.

Links for the Week of 2009-03-13

SQL Server

SQL Server and NULL Values, Revisited Aaron Alton takes a good look at NULL values and makes reference to post on the same topic. They both provide good information and well-founded opinions on NULLs and their place in the database.

Does a GUID make a good clustered key? This is a subject that is near and dear to my heart and if you’re ever within earshot of me, please don’t mention that you use GUIDs for your clustered indexes. This is a much more well thought out argument than mine usually are, and I will memorize it for the next time I hear that horrible phrase “I’m using a GUID as a clustered index…”

Development

Patterns And Practices Application Architecture Guide 2.0, Something Everyone Should Read The new Patterns and Practices architecture guide is out. Get it while it’s hot! This document covers architectural best practices to help minimize costs and maintenance.

MacRuby 0.4 Mac Ruby 0.4 has been released with a slew of new features. If you’re a ruby developer and you’re also a Mac user, this is definitely something you should look into. This is Ruby that runs along side the Cocoa/Objective-C framework, natively, on your Mac. Good times!

Stuff & Things

Drinking Games: Upgrade Conference Call Edition Ever spend too much time on a conference call during an upgrade? Brent Ozar provides a humorous take on these seemingly ubiquitous phone calls. Read this and laugh to yourself the next time you’re up at 3 in the morning with 5 or 6 other grumpy, tired, people.

New emoticons for the skull spring formal There is no explanation for this.

Sorry about the lack of links last week, I had a fever or flu or sinus infection or something, but it made it difficult to concentrate very well and do anything apart from complain about being sick.

CBusPASS Meeting Tonight!

The Columbus, OH chapter of PASS is having a meeting this evening at Battelle For Kids 1160 Dublin Rd, Suite 100, Columbus, OH 43215.

Tonight there will be two presentations on the topic of dynamic SQL. George Brown, Database Manager at Century Insurance Group, will be presenting on avoiding SQL injection attacks with dynamic searching, and I will be presenting on general dynamic SQL tips, tricks, and techniques to help you keep everything running smoothly.

The fun starts at 6:30PM EST. Pizza and soft drinks will be provided and there are still spots available, so feel free to register.

Crafting Presentations

First off, why did I title this “Crafting Presentations” instead of something along the lines of “How to Write a Kick Ass Presentation”? Two reasons. One, I didn’t want to. Two, I think that there’s more involved in a presentation than writing.

Yes, there is a lot of writing involved in a presentation, but it’s a different kind of writing than a targeted blog post. A presentation has to quickly convey information to an audience that might only be marginally interested in the topic or who might just be there for the free pizza, although I hope people come to my user group for more than free pizza and soda. Presentations also engage the audience on multiple levels. There are the words and images on the slides, the speaker, and any demonstrations. All of this needs to flow together well. It’s not just writing for the screen, it’s a mixed multimedia extravaganza! (Maybe I should work on a presentation involving a fog machine and a laser light show…)

Just the slide deck and notes alone occupy a considerable amount of time and effort, but the code samples require significant attention. While putting together the code samples for tomorrow’s presentation on dynamic SQL, I think I wrote about 4 times as much SQL as I ended up using. Taking into account that my sample code tops out around 800 lines, that’s a lot of sample code to write.

Why did I write so much sample code only to throw it away? Was it all crap? No. The sample code that I threw away was actually pretty decent code. It just didn’t work clearly enough. There were more than a few examples that I wrote that did more to show just how clever I could be than they did to illustrate the points in my presentation. And, at the end of the day, I really do want people to know how clever I am. And, at the end of the day, I really want the audience to come away with a clear understanding of the topic.

A few people have asked me how much time I spend on presentations. I never really had a good answer until I paid attention while I was putting this presentation together. It turns out that I spend between 20 and 40 hours putting each presentation together. A lot of this time is spent coming up with good code examples and making sure that each topic clearly flows to the next topic and that the code samples follow a logical progression starting from the simple and building toward a complete finale – like a really good movie about a cat and dog that lose their family only to journey across several states and finally be reunited in with the missing family in the last five minutes in a heart rending scene that leaves the audience in tears.

There’s a lot of craft involved in a great presentation. Everything needs to flow from beginning to end, educate the listeners and, ultimately, leave them in tears.

This site is protected with Urban Giraffe's plugin 'HTML Purified' and Edward Z. Yang's Powered by HTML Purifier. 214 items have been purified.