Sunday, September 26, 2010

Regional Mentor and SQL Saturday

I have been a Regional Mentor for SQLPASS for a while now, and have been over a few different areas. With the last reorg of the areas of User Groups, aligning them more with the Microsoft regions, I am now over my area in the west again. In the southwest, to be more precise.
I have friends and acquaintances in a few of these User Groups, and hope to have more in the coming months.
For my own record keeping, and as full disclosure to any of you that may read this, these are the groups I am going to be assisting. http://www.sqlpass.org/PASSChapters/USSouthwest.aspx

Arizona - PhoenixArizona SQL Server Users Group
Arizona - Tucson
California - Los AngelesL.A. SQL Server Professionals Group
California - Mountain ViewSilicon Valley SQL Server User Group
California - Orange CountyOrange County SQL User Group
California - San DiegoSan Diego SQL User Group
California - San FranciscoSan Francisco SQL Server User Group
California - San Francisco & Mountain View AreaBay Area Microsoft BI User Group
Colorado - BoulderBoulder SQL Server User Group
Colorado - Colorado SpringsColorado Springs SQL Server Users Group
Colorado - DenverDenver SQL Server User Group
Hawaii - HonoluluHawaii.Net Users Group
Nevada - Las VegasSQL Server Society of Las Vegas
Utah - Salt Lake City SLC SQL Users Group
Utah - Utah County Utah County SQL Server User Group

It will be easy for me to deal with the two Utah UGs, as I am intimate with them already.
Luckily I have made some great friends in the Colorado area as well, due to presence on Twitter and Facebook, and simply getting to know these folks thru SQLPASS.
I'de love to make it back to my home state of California more, and get to know those folks. There is even a UG in Mountain View, which is one of the other offices of my current employer. I would think a trip to CA wouldnt be too hard for me to muster up, and drag along my family whom is enamoured with CA.
Arizona is an area I am familiar with, since I worked out of Phoenix offices of one of my past employers quite often a few years back, and I have traveled to Tucson a few times to participate in SQL Server World Wide User Group (SSWUG).
Nevada (Las Vegas) is closer than one would think, and in my early days of being a newlywed, before being a parent, we used to visit there quite often. Before getting married, i would travel thru Vegas often between my boyhood home in California and school in Utah. I would love to visit Vegas more often for UG needs. And an excuse to get away. Its only 6 hours away. It almost begs for a weekend trip.
The last area that I am assisting is the one I have little contact with. I suggested that all RMs get monies from PASS to visit all the UGs they can, and obviously Hawaii would be first on my list of visits. I do know a great guy that lives there.

All in all, this is kinda my attempt at divulging my stewardship and some of the desires of my heart to assist with these UGs.

Now, speaking of SQL Saturday. I had a great opportunity to visit Denver SQL Saturday this actual weekend, but declined. My excuse is that it is my daughter's birthday today, and I didnt want to drag her to a 'old computer nerd convention' (her words). I do think that she would have enjoyed parts of it as a weekend away with dad, but for sure parts wouldnt have been enjoyed. In any event, i skipped Denver SQL Saturday.
Coming up is the Utah SQL Saturday that I am helping out with currently. This one will be easy to help with and attend.
I intend on making plans to visit other SQL Saturdays, as many as I can muster, that are in my area of stewardship. There is one in Phoenix in February. I need to start making some plans to figure out how to get there, and attend and participate.
As other SQL Saturdays pop up, I want to attend.

For those of you that are interested, here are all the SQL Saturdays that are on the docket currently. http://www.sqlsaturday.com/


Wednesday, May 26, 2010

Kalen Delaney Speaking In Denver on June 9, 2010

A good friend of mine, whom i have yet to meet, Chris Shaw (blog|twitter) was asking me recently how to promote a a great event that they are having in Denver. There are many many ideas out there for promoting events. This is my attempt at helping out and getting the word spread.



Below is a blurb about the event.
--------------------------------------------------------------------------------------------

Well-known SQL Server MVP and author Kalen Delaney (blog) will be speaking about SQL Server Plan Cache and Recompilation on Wednesday, June 9, 2010 at the Denver Marriot Tech Center on 4900 South Syracuse Street, Denver, CO 80237. The event is free, but you need to register in advance here.

Kalen has written a number of excellent books over many years about SQL Server. She is very well regarded in the SQL Server community, especially by her fellow SQL Server MVPs. If you are in the Denver area, you should take advantage of this opportunity to hear her speak.


Thursday, March 25, 2010

What do Statistics have to do with Scripting Jobs?

We have consistently scripted out our jobs from our Production systems and stored them in source control. We have close to 100 jobs on our main system, which has 4 total copies in an HA environment. We also have support systems that are likewise duplicated with much less jobs. Making quite a few copies of jobs. Lets say 15 systems, with 4 of those systems having 100 jobs. Doing this manually from SSMS will take me some time to accomplish, and only introduces my human element, which much to my chagrin, is not perfect. I cant count the times that I have generated all the jobs, stored them in source control, then as a failsafe simply counted the jobs, and compared against the files I generated only to find i was missing a few. Which ones? And the search is on. Needless to say, this can be a tiresome chore, a time-suck, and an overall frustration in the rear. Why not automate this, you say? Great question. The first few times, we needed these stored in source control in a time sensitive way, and simply did it the awful painful manual way. When time alloted us, we attempted to find some solutions to perform this task in a more easy fashion. We scoured the internet for other solutions and ideas, and settled on a VBscript that uses DMO to produce script files for each job. We plugged this code into a DTS, and away we went, somewhat blindly.

The next time someone on the team needed a job, they could simply refer to source control. There they were all, awaiting some DBA to use them. Said DBA opens the file, and attempts to load the job on a system, only to encounter an error. Odd. Face goes into that half scowl, half frown as they attempt to dig into the job code and understand why it failed. After a few stabs at it, its realized that this code will not work as is. How many other jobs will not work? how long have we been backing up jobs via script and it not working? Well, a smart man would say, since we introduced the automation to save us time. Back to the drawing board to find out what is wrong. In a quick overview, a couple things were wrong with these scripts. There is an sp_Add_Category proc call that was missing a named parameter. @name was not referenced, and the command failed if the category was not present. The servername was included sometimes, and not others. But the worse was that the job steps were not in the proper sequence. The script would attempt to create step 2 before step 1, and, well, SQL Server didnt seem to like that. So, any job that had more than 1 step, was potentially scripted incorrectly, and useless. The other issues were issues, but this step thing was a show stopper. Yeah, back to manual job script generation we go. I can actually script out 100 jobs in about 8 minutes, if i am not interrupted. Click the job, hit F2, copy name to clipboard, hit escape, right click job with mouse, hit S, then C, then F, which will select menu options to Script to file, paste name into File dialog, hit enter, move to next job, repeat. Nice and automated, huh? Not!

A coworker started digging at the VBScript code, as well as other options. After a bit of time, made the discovery that the code was ultimately hitting a table (sysjobs) that had its statistics out of date. Another index was being used, step name, and this was determining the order for the output of the DMO code. After updating statistics on the sysjobs tables, viola! Steps were now in order. Wow. Odd. Wow.

So, we set to talking about this. We had auto statistics configured on this database. However, statistics dont get kicked off until a percentage of the table changes. There are 100 jobs on the system, and they have been there for a long time. We may add 1 or 2, maybe 5 in a year. Not a lot of change. So, I could see how they may have gotten out of whack, and we not even really known, since its such a lowly piece of the system. But with a weird side-effect.

With statistics updated on the systems, and some slight modifications to the VBScript code, we once again have an automated approach to generating Job Scripts for each job, so that they can be saved in Source Control. And this time, we are testing the scripts generated, to ensure that they actually create jobs, and can execute successfully. No more assuming they are good, only to find all the steps out of order.

Thursday, February 25, 2010

sqlPerspectives guest blogger

Last week, I got a unique opportunity handed to me by Chris Shaw (blog|twitter). He allowed me to review a section of the Deep Dives MVP book that most of you have heard so much press for recently. This was a great chance for me to read from the experts and comment on their writings and insights. As we all know, we are the community. We are the lifeblood of this great SQL Family of folks trying to help others as well as ourselves. We are writing, we are mentoring, we are training, we are working with SQL Server. My first thought was who am I to actually comment on something like this, but that is the Evil TJay that is always trying to beat me down, and bruise my ego. Luckily the Good TJay won out that day, and I agreed to read and comment on a section.
I took this as seriously as my first book report way back in the day. I read it all, and reread it, and as I wrote my comments, read it again. I really wanted to be accurate, through in my perspective, even a story or two from my own experience. In an effort to become a better writer myself, this is exactly the type of thing that I relish. So, thanks go to Chris for allowing me to comment. Thanks to Jeremey Lowell as well for assisting with this small endeavor. People I have never met, giving me the opportunity to grow, what a great community we exist in.

Anyway, without any more flowery language and metaphors, I present the tweet I saw this morning, with the link to the guest blog I produced. I hope that someone enjoys it as much as I did preparing for it, and executing it.


TWEET
DataRealized Blog: @tjaybelt is the sqlPerspectives guest blogger this week! http://bit.ly/9v0Qyf #SQLServer #SQL #SQLBlog #microsoft


I hope to do more, grow more, learn more. You are all part of this experience of mine, and hopefully I am part of yours on occasion.