What Three Events Brought You Here?

Looks like yet another chain-post going around, this time started by SQL Jedi Paul Randal on What Three Events Brought You Here? Interesting question and very similar to one of my very first posts Starting the SQL Journey? So I got tagged by not only Scott Gleason, aka @SQLScottGleason on Twitter, but also tagged by Luke Jian, aka @sensware on Twitter, and finally by Marlon Ribunal, aka @marlonribunal on Twitter. I’m guessing since 3 people tagged me I should definitely answer this one so here it goes!

Update: Ok now a 4th has tagged me, the lovely Donabel Santos aka @sqlbelle!

Update deux: Thanks for the tag Andy Leonard (@andyleonard)

As I mentioned before I’ve somewhat covered this topic in a previous post but this one is nice as it forces me to choose 3 key points.

1. YMCA Leaders Club

Eureeka! We have found it!In 8th grade I took part in an after-school flag football league put on by the YMCA. The league was ran by a guy named Chris Shraeder. Chris, in addition to working for the YMCA, also led the YMCA Leaders Club at our local branch. While playing in the league Chris asked me and a few others to come join the club. Up to this point in my life I had always been involved in some sort of leadership position such as Student Council or Safety Patrol (yeah that’s right, I wore that bright orange sash with pride!) but this was the first program truly dedicated to developing leadership skills. Leaders Club gave me the opportunity to lead various groups (teens, camp kids of various ages, even adults when I refereed adult flag football). One of the greatest things that this program allowed me to do was to really learn how to build and foster a community from the inside out and these skills ultimately helped me out a great deal to get where I am today.

2. Attending my first Tampa Bay SQL Server User Group meeting

http://tampasql.comThis was huge for me as it started my path into being involved with not only the local SQL community but ultimately the SQL community around the world! My first job out of college I worked as a desktop technician for the Southwest Florida Water Management District. In this position one of the responsibilities I ultimately took on was administrating a small web server that ran our desktop inventory web app. This app was back ended by an Access database. Yeah, you can already see where this one is going. So because I took a database course in college, and I said “yes” when my manager asked me to be the secondary for the department in SQL Server. The person who was the primary was my friend Eric Byszeski, whom at the time was the desktop staff supervisor as well as my predecessor in my position. He, like me, was also an accidental DBA and I learned what I could from him. Our environment was relatively simple in that we only had one SQL 2000 server that held several databases for small systems. Eric taught me the basics such as how to use Enterprise Manager, how to do backups and restores, and check database integrity. As I kept reading blogs and articles on how to improve your SQL environments my hunger to learn more kept growing. SQL 2005 came out and I soaked up everything I could about it. Luckily I got to stand up a new 2005 instance and got the excitement of setting up a new SQL server from scratch! Looking back I’d probably slap my old self for some of the choices made but hey, that’s progress right? Anyhow, in my adventures in learning I came across the fact that there was a user group in the area so I decided to attend. I was blown away by the fact that there were so many people just in my local community with so much knowledge and experience to share! From the local meetings and events, to the various blogs and webcasts, as well as the social networking with others from around the world I was able to grow professionally and personally. When I first started attending that group a few years back I actually did a show-and-tell type presentation wherein I basically admitted to the group that I barely had an idea of what I was doing. Now this week I’m helping our user group leader organize SQLSaturday #32 here in Tampa. It’s been a hell of a ride and there’s still so much more!

3. Meeting my Wife

GiggityI know that this might seem like a cheesy “gimme” to some but for me this moment truly changed my life. Brace yourself because I’m about to do some soul-baring, Peschka-style. Prior to meeting my wife I was like many post-college kids. Towards the end of college I picked up the habit of smoking umm…glaucoma medicine…a habit which stuck with me a few years. I was also surrounded with folks around me whom I considered friends but it wasn’t until I pulled back and realized how negative they all were and I was following the same pattern. My post-college life had me jump from “relationship” to “relationship”, going out to bars and partying almost every weekend and basically coasting through life. Then I met my amazing wife Jessica. One of the great things about her is that she is amazingly positive. At the beginning of our relationship, due to the fact that I always looked at the negatives rather than positives of a situation, we had our issues. As time went on I began to learn to stop being so negative and change my thought processes. During our courtship I did a LOT of growing up and soul-searching. I stopped doing drugs, I quit getting drunk (note: addictive personalities + alcohol = nothing good), I discovered that I have clinical depression and so I needed medication to balance that out, I separated myself from those I thought were friends and found that no longer being around people with negative behaviors really makes a world of difference. Jessica has also been my greatest supporter and best friend throughout everything (which is why I married her!). In terms of my career, one of the toughest things for me to do was leave SWFWMD as I had been there almost 5 years and I was comfortable. I knew I wanted to expand my SQL skills and I needed a place where I could do that. I found an opportunity with University Community Hospital (my current employer) and I was truly scared to make the leap but with Jessica’s love and support I finally made the jump and it has made all the difference. I would definitely not be here professionally or personally if I didn’t have her in my life and for that I’m truly grateful.

Tagging Time

Well at first I was going to tag Kevin “Caesar” Kline since he got missed during the last meme rounds. So given the fact that it’s taken me forever to get this post out, and since everyone else seems to have been tagged I am opening this up to the world. If you are reading this and you have a blog, consider yourself tagged!

Reblog this post [with Zemanta]

The Plague of Plagiarism

Bloggle Bloggle
I Can Haz Ur Blogz?

If you’ve got performance troubles with an application that stores data in SQL Server, and especially if it’s a home-grown application (not a store-bought app), you can get dramatic performance improvements simply by focusing on some basic indexing techniques.  These tips and tricks pay off more than pouring money into hardware that might look good sitting in the datacenter, but doesn’t really make the application significantly faster.

When I go into a shop to speed up an application I’ve never seen before, two of my favorite quick-hits are from the index performance tuning queries from SQLServerPedia:

  • Find unused indexes – these are indexes the SQL Server engine says it’s not using.  Unused indexes incur a speed penalty because SQL Server still has to add/update the indexes as records change, so they make writes slower.
  • Find missing indexes – these are indexes SQL Server wishes it had available.

The above paragraph and information sounds good doesn’t it? Well guess what? They’re not my words, they’re Brent Ozar’s words from his article on SQL Server Index Tuning Tip: Identify Overlaps. Now had I not mentioned that fact, would you think I wrote it? Well that is the meat of a hot topic that spawned today on Twitter in the SQL community. Apparently a young man who recently graduated college decided to open a blog focused on SQL Server, UNIX and Oracle. The problem lay in the fact that all the articles on his site were not his own. What this guy did was use an RSS aggregator to point to prominent sites (such as SQLServerpedia, SQL Server Central and SQLblog.com amongst others) and so their content was then published on his blog. The big deal was that 1) He didn’t ask permission to republish their content and 2) He didn’t make it clear that the article you were reading was written by someone else. The ONLY credit given is a very tiny blurb on his About Me page that says “materials in this site has been collected from various sites and blogs and for that I thank them”. Riiiiight, that’s not exactly proper citation. Given that this guy claims to also have gotten a Master’s degree, I would think at some point in his educational studies the mention of proper citation and what plagiarism is.

Upon learning of this site and its apparent violations, members of the SQL community who had their intellectual property infringed upon took action by leaving fairly straightforward messages on this about page informing him that he was in violation and needed to remove content immediately otherwise harsh actions could be taken. Within a relatively short period of time the author got the message (sort of) by removing the menu options on his site, yet the content still remains if you look for it. Due to this fact I expect DMCA notices to start flying shortly and if the blogger still fails to comply then his hosting company should drop the axe. What’s interesting about this situation is the conversation that was spawned afterward on Twitter.

Todd McDermid (@Todd_McDermid on Twitter) had the opinion that the SQL community reacted much harsher than we should have and blogged about it in his article Another Instance of Plagiarism. In his post Todd does bring up some good points in that perhaps the hardcore lynch mob approach was a bit rash and perhaps a gentle “hey buddy, do you realize what you’re doing is stealing?” might be a more diplomatic approach but the problem is that many of these guys in our community whom are prominent bloggers have been burned plenty in the past. Brent blogged on How to Take Action When Your Content is Plagiarized and in it described a situation (not first, definitely won’t be last) where someone decided stealing content was acceptable. Are the messages left on violater’s site that they have to take down content or face DMCA report the nicest? Maybe not. Is it a necessary evil because of the countless times these bloggers and authors have had to deal with this? Absolutely. Todd outlines that this particular case the blogger in question may be starting out and not know better but after a bachelor’s degree, master’s degree and reading the numerous blogs he’s aggregating (which incidentally have blogged before on just this topic) he should know better. One could argue about what exactly constitutes “common sense” in this right but I’d argue someone who has gone through a master’s program should be very well versed in the art of writing and proper citation.

Some would argue that “nobody lost out” by what this guy was doing but I would disagree. This is a violation of someone’s intellectual property. When you decide to blog on a technical level you are taking your time to help educate the masses. You’re putting in a lot of hard work into formulating something that is uniquely yours and sharing it. “But Jorge, this guy was just sharing FOR you (well not me because I’m not worth stealing from which is comforting on some level for the moment)”, yeah but he wasn’t making it clearly known that it was not his work. If someone has a SQL problem and they quickly Boogle out a question what if they come across the aggregator’s content before they get to yours (the source)? If the person needing a quick answer simply finds the answer on his blog and goes on his way, guess who gets credit for that? The thief. Sure this guy put a very tiny note in his about page but who is going to look in there when reading content? Now let’s take this up a notch. You’re on the job market and the prospective company (like many do) do a search for you on the internet to see what pops up. Imagine how good your word and reputation would be to them if they saw an entire community backlashing on you because you were knowingly stealing content? It’s not worth it!

So what does one do? Well you could ask the author for permission to repost content. For the record I asked Brent if I could borrow that first paragraph for this purpose (thanks Brent!). Or, and I know this is crazy, COME UP WITH YOUR OWN CONTENT! It’s not easy but it definitely pays off and in the end you get mad street cred *fist bump*. So don’t steal content, people work hard to produce this stuff and in the end you’re only going to make yourself look worse by pretending to be something you’re not.

Reblog this post [with Zemanta]

T-SQL Tuesday #002 A Puzzling Situation

NET h rgb 2
Image via Wikipedia

Well this is the second T-SQL Tuesday (my first as I missed the first one). T-SQL Tuesday is a great idea put forth by Adam Machanic (@AdamMachanic on Twitter). Here’s the summary of this month’s post challenge:


Have you ever found yourself unable to figure out the intricacies of how some piece of code works? Ever been confused by the results you’ve gotten back from a query, only to find out that something totally unrelated was going on? Or have you ever been compelled to wile away your spare time working on a “challenge” posted by some blogger?

For this month’s T-SQL Tuesday, I’m asking participants to write a blog post on a “puzzling” topic, along the lines of some of the following ideas:

  • Describe a confusing situation you encountered, and explain how you debugged the problem and what the resolution was
  • Show a piece of code that doesn’t behave as most people might expect, and illustrate the reasoning behind the discrepancy
  • Create a challenge for your readers to solve

As always, even given the event’s name the posts are not limited to T-SQL! Any component of, or software product related to SQL Server, is fair game. MDX, SSIS, LINQ to SQL, Entity Data Model, NHibernate, and any other software product that deals with SQL Server data can be featured in your post. Be creative!

That being said I’d like to share a little project I’ve been working on with some co-workers here at work. If you follow me on Twitter you’ll probably have seen some of this discussion and I’ve mentioned one of the other guys I’m working with, Matt Schultz (@mmzplanet on Twitter) also talking about this project. The other piece of our “development group” is another network analyst named Horace Knight. This story doesn’t contain any special programming tricks and I can’t post specific code at this time but this particular project has been an absolute pleasure to work on and work with these guys coming up with a from-scratch solution that works.


Recently here at the hospital we have put in phase I for a new GE system for our electronic medical records system. The thing about this particular system is that the application requires an XML file to be located on the desktop. This XML file contains some pertinent information for the application to work such as pathway (production/test/dev), terminal ID (an ID needed for client to be able to connect) as well as some other GE-centric information. The key thing here is that terminal ID, which allows a workstation to authenticate to the tandem system that contains our medical information. Well the way this works is that GE provides us with a pool of terminal IDs to divvy up amongst our clients and we’re supposed to manage them however we choose so long as those clients have that XML file. Now had this only been for 20-30 PC’s this might not be a HUGE deal but we’re talking about 2,000+ machines that are going to need to access this system, have their terminal IDs properly assigned to their proper locations (multiple campuses at play here as well) and be properly managed (i.e. no duplicates, correct locations, proper allotment per location, etc.). What puts the pressure on here is that the these locations REALLY need to be correct since the locations dictate where forms are printed to, forms that contain patient registration information.

Soooo…How Do We Do This?

So despite having GE tell us these things I’ve covered, the whole process was still a little confusing (took months of back and forth to finally understand and hammer out what I’ve just explained in a paragraph!). Horace, being the awesome human being he is, stepped up to the plate and took the responsibility of coming up with a solution to handle the terminal ID assignments. Horace worked hard with the folks at GE as well as hospital employees to get a high-level grasp of what was needed and expected out of this solution (such as locations, printers, workstation identifiers, etc.). We also got a few curve balls thrown at us in that not only regular workstations would be running this application but we would also need this solution to work on kiosk machines (locked down workstations being logged in with dedicated accounts) as well as workstations on our regular domain. As time went on, and our deadline loomed closer, Horace’s job became increasingly difficult because every time he thought he had it figured out something else would change and it was back to the drawing board. He had a vision of an application that would eventually manage everything but he had no programming experience and he knew this solution would require a database as well so this is where I came in. He and I started meeting frequently and fleshed out a general workflow as well as a database structure that would handle the various information we needed to do this. On the client side Horace was developing a script in VBscript that handled the various things we needed such as writing the needed XML file out with the custom terminal ID that would be assigned from a table in the database. Due to the way we had architected it at that point we were also creating another XML which contained location information for that PC. That location XML would not only allow the script to identify where the workstation was but it would let any PC technicians know where the machine should be in case of issues. This script would be delivered to workstations via kixstart script kicked off upon logging into the workstation. As some of you have probably figured out there’s lots of holes in this solution but bear with us, we know not what we do! Well our deadline date came, the script and database did their thing, and for the most part it worked as it was supposed to. Like any system there were a few flaws and things were learned on rollout day that we hadn’t anticipated or known and these were handled manually.

Enter the (.NET) Dragon

.NET: Yeah it's THAT badass

Once our go-live date came and went things finally calmed down a bit in our department for the first time in months. Now that the system was up and running it was time to go back and figure out how to clean things up. Matt came into the project when he volunteered his services by offering to build a GUI that would prompt the user at login for a location and that would then write the location to the XML file as needed. Now, this was the initial thought pattern but as Matt learned more about .NET (sorry pundits, he went with VB.NET as he had previous experience with VB syntax so VB.NET was easier/faster to pick up) and working with me more on revamping queries to the database and converting poor, simple queries into re-usable and secured stored procedures. During this time Matt took it upon himself to not only put a GUI over the script but improve the functionality and then some! I’m hoping that Matt puts up a post about this project as the current iteration really is culmination of Horace’s original vision for this application along with a lot of additional ingenuity and hard work from Matt and myself.


The current version of the script now works like this: The application will be delivered via an as-yet-determined means. When the application first starts the user is prompted with a GUI that allows you to choose a campus as well as location (this process is to be done by PC techs on new PCs so location/campus will be correct before gets to users). If the PC already has a location XML (which the current ones in production have) the application reads the current location information and checks the database for an existing record for the PC and makes sure location matches up. Since the PC is already providing the location information the GUI won’t even show up since it has the information it needs. Now the application is running in the notification area of the taskbar. If you access the application it shows you a GUI read-only interface that shows you some pertinent information including PC name, location assignment, and assigned terminal ID per pathway (each pathway access requires individual terminal ID). Matt broke it up to show not only what value was in the database but what value was in the local XML document so that you could see at a glance if values were set properly or needed updating. In order to manage and change values there is a button you click to access the management interface of the application. This area is secured via login prompt and Active Directory groups. Only members of a certain AD group are allowed access to this portion of the application to make changes. Once this secured area is accessed you can make changes such as location and adding/removing pathway accesses. The pathway add/drop processes are handled by stored procedures which are programmed to not only add and modify records  but it can dynamically pull additional terminal IDs if none are available for a given area (this was a concern as when we initially rolled out and told there were only 20 workstations in Area X and we come to find 5 more needed IDs assigned to that area it was a manual pain to add those 5 terminal IDs to the section’s pool). Another nice thing about having the database handle everything via stored procedures is that we managed to eliminate the need for that second location XML file on the workstation since all data needed was now stored in the database. Another addition from Matt’s hockey-filled brain was the use of a global settings table. This table would hold information that would be common to all clients such as registry path of the application, location of certain file that denoted whether the application was installed and client version level.

This is what what gets done before app even opens...

Now The Part You DBA Geeks Are Waiting For…

So besides all of the tables and stored procedures that are underneath this application, this project gave me the chance to try my hand at something else I haven’t had a chance to play with before: mirroring. Thanks to my fellow SQL tweeps and some quality time on Books Online I figured out how to modify our connection string to recognize a mirrored instance. It took some trial and error but I finally got my test database mirrored with a witness server so that I had a High Safety mode with automatic failover setup. Moment of truth came when we tested the application by opening it up, manually failing database over to its partner, then continuing to use the application. As expected there was a slight delay while the database failed over but the application did recognize the failover and continued working! NASA-style Apollo mission high-fives handed all around!

So now we’re at the point where this week is the final week of feature additions and testing and we plan to roll out to production in the coming weeks. We are very proud about how this whole thing has turned out especially considering Matt had never touched .NET as of 3 weeks ago and yet has managed to produce a very slick, full-featured application in this time. This project has really kickstarted my desire to learn more on the development side of the house hence those of you who follow me on Twitter have noticed me asking more and more about .NET, C# and all of those fun things you guys do.

Reblog this post [with Zemanta]

SQL University Feedback

Well the new year is here and I’m currently planning what’s next for SQL University this semester. I’m hoping to have a few more additions in staff as well as add some more interactive options to get everyone involved! I’ll have more details in the coming weeks about that. In the meantime I have setup a feedback form for SQL University. If you can, please take a minute to fill out this form. This feedback lets me know what we’re doing wrong/right and what you would like to see in the future. Thank you!

Feedback survey click here