SQL Summer Vacation–SentryOne

sqlvacation2017We are having an extra Louisville SQL Server and Power BI User Group meeting this month due to the SQL Summer Vacation coming into town. SentryOne’s Kevin Kline (B|T) will be rolling into town for a fun filled 2-hour event on Wednesday the 25th. This is a fun event that Kevin and family travel around for every year, and for our SQL community is a great time to sit in multiple sessions learning from a Microsoft SQL Server MVP.

Seats are filling up fast and should have a packed house over at Homecare Homebase whose gracefully opened their doors to host this event. John Morehouse (B|T) and I will both be in attendance and as PAC Ambassadors for SentryOne we would love to talk to you and answer any questions that you may have of us.

Look forward to seeing you all there; going to be a great and fun time. Head on over to the user group site here and check it out available seating.

Advertisements

PAC Community Ambassador – SQL Sentry

pac-logoLast week Aaron Bertrand (b|t) published a post regarding five new PAC Community Ambassadors for SentryOne. I am privileged and honored to be a part of this journey with some stellar data professionals:

  • Andy Mallon (b|t)
  • John Morehouse (b|t)
  • Derik Hammer (b|t)
  • Mike Walsh (b|t)

This venture is a new community program that SentryOne is starting this summer which allows us more avenues to get out into the community, stay connected, and continue to be involved in the programs that SentryOne has to offer.

Knowing each of the other four individuals I can without a doubt say that the mindset is focused on helping others. How do I know this you may ask? Because each of these data professionals has helped me over the years, and I know their drive and motivations to help others succeed.

Thanks SentryOne for the honor to continue to serve others and look forward to meeting, even more, faces as we travel around, collaborate, and impact the community!

T-SQL Tuesday #92, Lessons Learned The Hard Way

TSQL2SDAY-150x150Wow, hard for me to believe it has been a little bit since the last T-SQL Tuesday block party. This month Raul Gonzalez (b|t) has chosen the topic of what lessons one has learned the hard way. Before we get into the story, however, let’s take a look at who, what, when, and why of T-SQL Tuesday.

What Is T-SQL Tuesday?

T-SQL Tuesday was started by Adam Machanic (b|t) and is a monthly blog party. It occurs on the second Tuesday of each month; where a designated host picks a topic and fellow community bloggers publish a piece. It has been a very useful tool in my opinion and I’m looking forward to doing many more of these. It has been one avenue for others to share their experiences while learning something new along the way.

If you are interested in hosting a T-SQL Tuesday on your blog then reach out to Adam.

Lessons Learned The Hard Way

A lot has transpired over a sixteen-year career thus far. Many lessons have been learned along the way some were more difficult than others. I think it is important to note that not all lessons learned by a data professional have to be of a technical nature as well. Let me see if I can split some up technical vs. non-technical that I’ve learned over the years.

Technical
  • Unit testing – who knew that this would be so important right? As a developer starting out and then becoming a DBA I have an appreciation for making sure things test out as they should; rigorous testing. Earlier in my career, I thought that’s what we have QA for, right?
  • Backups – yeah I’ve been burned before early on regarding backups and not having them in place as they should have been. You want a dose of reality real fast? That’s a good way to start.
  • Blinders On – become so focused that you only take into account a certain area of the picture when in essence what is being changed can affect a multitude of things.
  • Knowing vs. Doing – putting comments in code such as “this is probably not the best way to things” is not the attitude to have when fixing the problem – been there done that.
Non-Technical
  • Listening/Heeding Advice – this is key and something I did not learn until later on in my career. It’s not a skill set that I came out of the gate with, having a mentality that you are always right is not the best approach to take.
  • SME (Subject Matter Expert) – I enjoy helping people; it’s part of who I am. This is both a good and bad trait to have at times. If you are not careful you can find yourself overextending into areas where you think you know something but you don’t. Over the past several years I’ve learned that it’s okay to help people even if it is pointing them in the right direction to someone else. But be as sure as I’m typing this, I’ll always be willing to help and will never apologize for that.
  • Conflict Management – over the years I’ve seen many data professionals and worked with various people. All of these experiences have equipped me over time to become a better professional in dealing with conflict which is never easy. A lot of lessons learned along the way on this one.
Failure

I want to bring this topic up in a section all by itself. Having a sports background for most of my life, and then morphing into an avid runner I’ve had “failure is not an option” instilled within me since a very early age. This saying is okay, but in the same token, one cannot be afraid of failure. Some of the best lessons I’ve learned both professionally and non-professionally have come of a result of something I’ve tried and failed out. The key is not staying knocked down, but look at it in a light of if you aren’t trying then you aren’t failing and pushing the envelope.

In Summary

This is a great topic this month. Don’t be ashamed or afraid of your journey and past failures or lessons learned. These are the things that mold and shape us into being the people are to become in the future. May we continue to push the envelope both in technology and beyond; impacting and coaching others along the way. Always remember you started somewhere; remember how that felt? Pay it forward.

Built My Presentation, Now What?

IMG_20161025_092017_01Over the course of several years, I have given many technical and non-technical presentations. It is fun for me to put a new slide deck together, but it also requires a lot of hard work and can be time-consuming. I’ve had a few mistakes, to say the least, over the years where that one typo slips through or something doesn’t go according to plan ~ guess what? It happens.

I compare articulating a presentation to similar fashion in testing something. Yeah, you go over it again and again just like you would test a backup process or verify indexes are actually working. For me the same concept applies; I can’t remember who in the SQL Community always mentions having a checklist handy. I know I’ve read that somewhere before but cobwebs are thick right now so, please, forgive me if I don’t remember. Through the years, I’ve managed to build my own checklist regarding presentations. It is the nuts and bolts of what works for me; it doesn’t necessarily mean it, in turn, will work for you.

Given light of some past conversations I’ve had, I figured I’d share it with you all and maybe someone out there will benefit from it.

Presentation Checklist (a.k.a. Project Double Check Yourself)

What is the purpose – fully understand the purpose of the presentation. By that I mean, what outcome are you seeking?

  • To inform
  • To convince
  • To generate insight and discussion
  • To drive action

Know your audience

  • Do you know who my audience is? Have I provided adequate context to make it easier for them to understand?
  • Are there any personal motivations that you need be aware of?
  • Is the audience familiar with the topic? Have you included adequate detail and background information?
  • Is the presentation tailored to fit the audiences communication style?

Know the message

  • If applicable, do you know the problem or issue you are trying to address?
  • Do you have three to five key teaching points you want to deliver? If so, have you tied those teaching points logically and clearly to the original problem?
  • Have you clearly linked your teaching points to key data or trends along with explaining how the analysis supports, confirms, or denies beliefs about the problem and/or possible solutions?
  • Have you limited the data to what matters most?
  • Have you clearly established relevance? (why would your audience care? Have you clearly highlighted how this aligns with the target audience?)
  • Have you clearly established urgency (why would the audience act now; why is it critical?)

Structure

  • Is the presentation clearly marked with markers and sign posts? Is it easy to follow?
  • Is there an agenda that clearly identifies the different elements and how it fits together? Key point up front?
  • Are there additional details about internal or external sources that were consulted for the included information? Give credit where credit is due

Narrative

  • Does the presentation include insights that will be most influential to the audience? Is the scripting memorable and powerful?
  • Does the presentation identify key assumptions?
  • Does the presentation articulate immediate actions that you believe the audience should take?

Graphics

  • Do you know the purpose of each graphic? Is it tied to a teaching point in the message?
  • Do the graphics present information in a logical, visually appealing manner? Are there other ways of interpreting the graphic other than your intention?
  • Is the page balanced?

Formatting

  • Does the presentation have a standardized look and feel (same headings, colors, fonts)?
  • Are page elements consistent (background, title, body text)?
  • Are colors used judiciously (to emphasize, highlight, and organize)

Conclusion

Checklists; they are everywhere. They don’t necessarily have to be for technical related activities; heck we use checklists for grocery items. They are a part of our daily lives; so when you get that presentation built and you are ready to give it at your shop, on the job, a conference or a client take a few minutes and review a checklist. Make sure you have your house in order and that everything makes sense.

Remember, you get out what you put into something. Continue to work hard and hone in on your speaking and presentation talents that lie within. Like I said, these are some of the things that have helped me over the years; doesn’t mean they are for everyone. The flip side to that, you may have some of your own to share. I encourage you to do so.

 

Personal Ownership–The Vision Within

vision-imageIt has been said that the very essence of leadership is that you have a vision. It has to be a vision you can articulate clearly and precisely on any occasion. There is a vast difference between a person that has a vision and what is called a visionary person. Think of it in this manner:

  • A person with a vision talks little but does much.
  • A visionary person does little but talks much.
  • A person with a vision finds strength from inner convictions.
  • A visionary person finds strength from outward conditions.
  • A person with vision continues when problems arise.
  • A visionary person quits when the road becomes difficult.

Some of my personal experiences have taught me the following:

  • The credibility of a vision is determined by the leader.
  • The acceptance of a vision is determined by the timing of its presentation.
  • The value of the vision is determined by the energy and direction it gives.
  • The evaluation of a vision is determined by the commitment we the people have.
  • The success of a vision is determined by its ownership by both the leader and the people.

Take a look around you; what is happening to others

A good idea can become great when the people are ready. The data professional who is impatient with people can become defective in their leadership. The evidence of strength lies not all the time in blazing a trail ahead but instead adopting our stride at a slower pace while not forfeiting the end goal. If you run too far ahead then you run the risk of losing your power to influence.

The ability to decipher the big picture

The ability to decipher the big picture is oftentimes what separates leaders. They are concerned with the shop’s basic purpose of why it exists and what it should achieve. Some things to think about that may hinder a vision:

  • Limited Leaders – everything rises and falls on leadership.
  • Concrete Thinkers – see things as they are and say why?
  • Dogmatic Talkers – to be absolutely sure about something one must either know everything or nothing about the problem. At times knows nothing but conventionally says something.
  • Continual Failure– many people look at past failures and fear the risk of pursuing future visions.
  • Satisfied Sitters – people who strive for comfort which sits on the heels of complacency, predictability, and boredom.
  • Census Takers – some people are never comfortable stepping out of the crowd.
  • Problem Receivers – some people can see a problem in every solution.
  • Self-Seekers – people who live for themselves.
  • Failure Forecasters – extract only discord; outlook is always gloomy and times are always bad.

Summary:

Spend some time and think about the dreams and vision you have as a data professional. Whether you are in an organization or a consultant I challenge you to consider the following:

Refuse to accept failure with self-worth.

Don’t restrict thinking to established, rigid patterns.

See the big picture.

Welcome challenge with optimism

Don’t waste time in unproductive thinking.

QA, Utility Databases, and Job Executions

thinking-outside-the-box1Sometimes we, as data professionals, have to think outside the box. I know, crazy idea right? Each shop and situation are different; there will always be several different ways in most cases that you can arrive at a solid solution.

 

This post has a few intentions behind it:

  • It is not a “take this solution; it’s the only way”.
  • Generate some thought and additional methods to reach a goal.
  • This is not intended for a production environment.

Good, now that we have those few things out-of-the-way let’s get to the meat of the topic. A situation arises where you want to give a bit more control to teams to execute jobs without giving full access to the SQL agent. In that case a good utility database may come in handy.

Example of an issue: A QA team is in need of kicking jobs off to test in a specific environment. Keeping in mind that each shop can be different this also means that security levels at varying shops will be different. There are a few choices that may come to mind with this issue:

  • Fire off an email to the DBA team and wait for them to kick job off.
  • Fire off an email to someone with access and wait for them to kick the job off.
  • Wait for the predefined schedule on the job agent and let it kick the job off.

Another method would be to utilize a utility database. You can give it whatever name meets your criteria in this case we will just call it TestingJobs. Let’s look at the overall picture below and how this all fits together:

Things you’ll need

  • UtilityDatabase
  • Two Stored Procedures
  • Table
  • Agent Job

Step1: Create the TestingJobs database (I won’t go into specifics here on proper set up; assume this is already created).

Step2: Create a table called ControlJobs inside the TestingJobs database

USE [TestingJobs]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ControlJobs](
[JobControlID] [INT] IDENTITY(1,1) NOT NULL,
[JobName] [VARCHAR](500) NOT NULL,
[RunStatus] [BIT] NOT NULL DEFAULT ((0)),
[LastRanBy] [VARCHAR](50) NOT NULL,
[LastRanByApp] [VARCHAR](150) NULL,
[Date_Modified] [DATETIME] NOT NULL DEFAULT (GETDATE()),
[Active] [BIT] NOT NULL DEFAULT ((1))
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

Step3: Store procedure creation for table insertion (note the parameter @JobName)

USE [TestingJobs]
GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

ALTER PROCEDURE [dbo].[test_StartJobs] ( @JobName VARCHAR(100) )
AS
BEGIN

        /************************************************************************
This script will insert the record needed to kick off agent jobs.

        ************************************************************************/

INSERT  INTO [TestingJobs].[dbo].[ControlJobs]
( [JobName] ,
[RunStatus] ,
[LastRanBy] ,
[LastRanByApp] ,
[Date_Modified] ,
[Active]
)
VALUES  ( @JobName ,
1 ,
” ,
” ,
GETDATE() ,
1
);

END;

Step4: Set up stored procedure that will run the pending jobs.

USE [TestingJobs]

GO

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE
[dbo].[RunPendingJobs]
AS
SET NOCOUNT ON;

    DECLARE @JobName VARCHAR(500) ,
@JobStatus INT ,
@RC INT;

DECLARE cur_RunJobs CURSOR
FOR
        SELECT  JobName
FROM    Ddbo.ControlJobs
WHERE   RunStatus = 1
ORDER BY JobName;

OPEN cur_RunJobs;

FETCH NEXT FROM cur_RunJobs
INTO @JobName;

WHILE @@FETCH_STATUS = 0
BEGIN
PRINT ‘Checking to see if job is currently running. ‘;

EXEC @RC = dbo.GetCurrentRunStatus @job_name = @JobName;

IF @RC = 0
EXEC msdb.dbo.sp_start_job @JobName;
ELSE
PRINT
@JobName + ‘ is currently running.’;

UPDATE  ControlJobs
SET     RunStatus = 0 ,
Date_Modified = GETDATE()
WHERE   JobName = @JobName;

FETCH NEXT FROM cur_RunJobs INTO @JobName;

END;

CLOSE cur_RunJobs;
DEALLOCATE cur_RunJobs;

Step5: Set up stored procedure to check if job is already running

USE [TestingJobs];
GO

SET ANSI_NULLS ON;
GO
SET QUOTED_IDENTIFIER ON;
GO
ALTER PROCEDURE
[dbo].[GetCurrentRunStatus] ( @job_name sysname )
AS
SET NOCOUNT ON;

    /* Is the execution status for the jobs.
Value Description
0 Returns only those jobs that are not idle or suspended.
1 Executing.
2 Waiting for thread.
3 Between retries.
4 Idle.
5 Suspended.
7 Performing completion actions  */

DECLARE @job_id UNIQUEIDENTIFIER ,
@is_sysadmin INT ,
@job_owner sysname ,
@Status INT;

SELECT  @job_id = job_id
FROM    msdb..sysjobs_view
WHERE   [name] = @job_name;
SELECT  @is_sysadmin = ISNULL(IS_SRVROLEMEMBER(N’sysadmin’), 0);
SELECT  @job_owner = SUSER_SNAME();

CREATE TABLE #xp_results
(
job_id UNIQUEIDENTIFIER NOT NULL ,
last_run_date INT NOT NULL ,
last_run_time INT NOT NULL ,
next_run_date INT NOT NULL ,
next_run_time INT NOT NULL ,
next_run_schedule_id INT NOT NULL ,
requested_to_run INT NOT NULL , — BOOL
request_source INT NOT NULL ,
request_source_id sysname COLLATE DATABASE_DEFAULT
NULL ,
running INT NOT NULL , — BOOL
current_step INT NOT NULL ,
current_retry_attempt INT NOT NULL ,
job_state INT NOT NULL
);
INSERT  INTO #xp_results
EXECUTE master.dbo.xp_sqlagent_enum_jobs @is_sysadmin, @job_owner,
@job_id;
SELECT  @Status = running
FROM    #xp_results;
RETURN @Status;

DROP TABLE #xp_results;

SET NOCOUNT OFF;

Step6: Job Creation

Create a SQL agent job that will call the RunPendingJobs in the database. You can set this schedule to three minutes for this test.

The Benefit

Now think of a QA team member sitting at their desk running multiple tasks. This does take some coordinated effort in getting the job names but now that the basics are set up the team member could run the execute command for the test_StartJobs which will place the necessary information into the control jobs table. Of course the proper security would need to be set up in order for the user to be added (think AD groups). By utilizing the above method the team can suffice on it’s own in a non prod environment streamlining some of the inefficiencies that have plagued the groups in the past.

Summary

A few things to note here:

  • Don’t ever take code off the internet without testing it. This is just a thought-provoking post and there are some things in this post that are dependent upon one to set up and test.
  • I realize there are multiple ways to accomplish this. This is just an avenue to explore and test with some thinking outside the box.
  • Don’t limit yourself to “I can’t” or “This will not fly at my shop”; challenge yourself to become innovative and think of ways to tackle problems.

Can a Data Professional Be Organized?

Organization“One of the advantages of being disorderly is that one is constantly making exciting discoveries.”  While this quote is true it is often times too late to act on an opportunity therefore it is missed. If you are a leader at your respective shop it can then be conceived that you are somewhat out of control.

Becoming a bit more organized in your day will allow you to have priorities that are clear in your mind and can help you orchestrate complex events with a masterful touch. You can transition smoothly from one project to the next without wasting motions. People will begin to believe the promises you make because you are following through on them. When you enter a meeting you are prepared for it and when you show that hand of knowing the topic ~ well it pays off.

It might sound funny, but I run into a lot of data professionals who are and are not organized. I get it; it happens to everyone – but if you are interested in taking steps to become organized below are some thoughts that may help you on your journey.

Set Your Priorities

Sounds easy enough? Two things that are difficult to get people to do. The first is to do things in order of importance, and the second being continuing to do the things in order of importance. Try listing out all your major responsibilities according to importance and time needed to accomplish those tasks. This will become the gauge to help keep you on track and keep moving forward. Perhaps start with a monthly checklist.

Place Priorities In Your Calendar

Place this list in a prominent area such as your calendar. You could also share this list with a trusted resource for accountability sake pending on the nature of the item.

Allow Time For The Unexpected

We all know that things will come up; that is inevitable. Based on your role as a data professional you can build in additional time to the priorities that need to be accomplished.

Do Projects One At A Time

A feeling of being overwhelmed is the result of too many projects that are clamoring for your attention. If this is something that happens to you then maybe try some of the following:

  • Itemize all that needs to be completed.
  • Prioritize things in order of importance.
  • Organize each project that suits you such as a folder.
  • Emphasize only one project at a time.

Work According To Your Temperament

If you are a morning person, then schedule time in the morning to be most effective; if you are a late starter then do the opposite. Whichever holds true, be sure to not allow the weaknesses of your temperament excuse you from what you know you need to do to work most effectively.

Use Your Driving Or Travel Time for Light Work And Growth

I was given some great advice a long time ago. Whether you ride the subway or drive the car use this time to reflect on your thoughts. I have several friends for instance who, while on the subway, knock out tasks or read a book that continues their growth process as a data professional. No, I’m not saying never turn on the radio for a jam session, but I am saying you may find some useful time on the drive in to the office.

Develop Systems That Work For You

Whether you utilize your phone, computer, calendar, or writing tasks down – all of these are there to help you do things better and quicker. By improving them, you can decrease your expenses and increase your results. Don’t fight the systems; instead improve upon them. Remember, you are the CEO of your journey.

Always Plan For Those Minutes Between Meetings

I find myself in meetings constantly. That can be both good and bad. Hours can be saved by making the best use of minutes in between meetings. I try to keep a list of things to do that can be done anywhere in a very short amount of time. Keep handy a list of things you can do in a short time such as:

  • Email reply.
  • Call to make.
  • Thank you note to jot down.

Focus On Results, Not The Activity

Doing things right versus doing the right things? Focus on doing the right things and what is truly important. Welcome responsibility and be responsible for who you are. It is often rare to find a person who will be responsible, who will follow through correctly and finish the job. An old boss of mine once told me the following:

“I am only one, but still I am one. I cannot do everything, but I can do something; and because I cannot do everything I will not refuse to do the something that I can do”

Summary

Whatever the case may be take steps to improving yourself along your journey and look for ways to help improve efficiency on your day-to-day processes. These items mentioned are just to provoke your thought process; not something that is or should be a standard for you. If you’re struggling; maybe try some of them out and see how it works for you. Don’t expect more from others than you expect from yourself. Get after it and let’s get it done.