Resolved: A Duty to Act

If you are a member of PASS, you probably got an email from our President, Thomas LaRock.  I interpreted his email as essentially a reminder that when attending PASS events we should all be professional and responsible for our actions.   The email was very well written and wasn’t pointed towards just men or women, but all of us.

Along with Tom’s email, PASS Board member Wendy Pastrick bravely put out a post about one of her own personal experiences at the 2015 PASS Summit.  I consider Wendy a friend and I’m very proud that she reported her incident.  It’s not easy to do that but that was the right thing to do.   Wendy deserves a lot of kuddos for doing that.  Well done Wendy.

In a Previous life…

Those that know me, know that in a former life I was a volunteer fire fighter & EMT.  In that role, I would sometimes be placed into a situation where I didn’t have a choice if I reported something or not.  For instance, any suspected evidence of child or elder abuse; I was required under state and federal laws to report it to authorities.  Not reporting it wasn’t an option. Granted, the actions of individuals at recent PASS events are not necessarily on the same plane as child abuse, but nevertheless I think that it should be handled in the same fashion.

Additionally, in one of my other former lives I was a bouncer.  I know, big shock, right? Anyhow, being in the role of people depending on me to protect others makes me want to jump in a take action when I hear of situations like this. I’d like to think that I’m the type of guy that can be trusted and will take care of business when needed. Not to mean that I would initiate physical fights (although I was in a couple) but rather I know how to handle people in such a way to resolve the issue.

Some History

That all being said. At the 2014 PASS Summit, I was notified by a friend that she had received questionable social media messages. She showed me the messages and I too agreed it was of an unprofessional nature.

At the time, I was a Regional Mentor.   I had a duty to act and to uphold the code of conduct that was passed by the Board of Directors.   So to make a long story short, I consulted another regional mentor that I trust (with my life) and we agreed that it was our job to report the incident.  So we did.

We both recognized it was NOT our job to be the judge and jury.

It was NOT our job to confront the perpetrator.

It WAS our job to make the issue known to the proper authorities. Note that my friend was very capable of talking to correct people on her own, however she was unsure whether she was over reacting and was worth reporting. So we took action on her behalf, we found out about the incident, we acted.

My Resolve

Let me be honest.  I’m tired of hearing of my good friends having issues with mis-conduct by members of PASS.  I am also tired of feeling like I don’t have any way to help and I know others do to. I’m a firm believer that things cannot be fixed if the people that can fix it aren’t made aware of it. Therefore I resolve that:

  • If you bring it to my attention, I will report it to the proper PASS authorities, whether you want me to or not.
  • If I observe such actions directly, I will report it to the proper PASS authorities.
  • I will make myself available to anyone who finds themselves in an uncomfortable situation, male or female. Just get my attention and I am there.

Just so I am clear.  I will not physically engage anybody in any way shape or form.  I do not and will not condone any type of physical intervention unless it’s a matter of safety.

To My Fellow Men

Given that most of the perpetrators are most likely men I have a few tips for you from my bouncer days.  From talking to my female friends that attended Summit one of their biggest issues was men’s roaming hands in a crowd. I’m not a small guy (I’ve been called a bull ox a time or two) so I know a thing or two about moving through a crowd:

  • Put your hands up.  If you have to move through a crowd of people, both men and women, put your hands up so that you don’t “accidentally” brush up against someone.
  • If you have to get someone to move, say “Excuse me”.  If they don’t hear you, say it louder.
  • Get the attention of people that they might be talking to.  Most individuals when they see you trying to get by will get the attention of the person in your way for them to move.
  • Find an alternate path through the crowd.  Crowds are like waves of grain in the wind.  They move and flow as people move around and enjoy the event.  If a particular path is congested with people, back off and look for a different path.
  • As a last resort, if you have to touch someone to get their attention, tap them on the shoulder while again saying “Excuse Me”.  With a single index finger.  Not your whole hand.  A finger.  DO NOT TOUCH THEM anywhere else.

Summary

Fellow #sqlfamily member Erin Stellato put out a fantastic post about being the change. Her article is well written and is spot on.   We all can be the change that is needed.  Be that change.

It’s our job as PASS members as well as just being human to make it a better place for everybody.  I take great pride in our #sqlfamily as well as being a member and I am here for anyone who needs me.

 

Posted in Community | Tagged , | 5 Comments

MVP of The Month

If you follow Grant Fritchey (B|T) at all, you know that every month he picks a “Speaker of the Month”.  Grant attends SQL events over the course of a month.  Out of all of the sessions he attends during that month, he will pick a winner and write a blog post about it.

I applaud him and think this a great way to showcase speakers, both new and old, to the general public.

As a side note, if you are not following Grant, you should be.  He’s a MVP, on the PASS Board of Directors and he knows a thing or two about SQL Server.

Not Everyone is a MVP But They Can Be

There are a ton of individuals out there that do a lot of work for the SQL community and have yet to achieve MVP status.  They, like me, love to share and give back to others. Having been nominated myself, I can tell you that knowing that someone took the time to nominate you and to recognize your efforts is a complete honor and a huge motivation to do more.

With that being said, much like Grant’s Speaker of the Month, I’m going to do a nominate “MVP of the Month” for 2016.  Essentially, each month next year I will nominate one individual that I think is deserving of the award.  I will take note of individuals speaking physically or virutally, at SQL Saturdays or other events.  They may not be a speaker but contribute and standout, via Twitter, help in online forums or any other medium that showcases their “MVPness” I deem appropriate.

After nominating the individual, I will blog about that person as to why I think they deserve the famed MVP award.  Start watching my blog in January for my first selection!

Nominate Someone

I can speak from firsthand experience that being nominated is indeed an honor.  If you know of someone that has shown the values of being an MVP and isn’t, take the time to nominate them.  I assure you that you will make their day.

I challenge you to nominate someone in your circle.  Even if it isn’t for the MVP award, nominate them for something.  If they are a PASS Volunteer, the outstanding PASS Volunteer award is another excellent choice.   Blog about their achievements and get them recognized.  You will be amazed on how much it can make a difference.

If you do want to nominate someone for the Microsoft MVP award, you will need to know their email address and can submit the nomination here.

Need more convincing?  Fellow SQL Family member Mark Broadbent (B|T) has similar advice.  He has a great blog post about it here.  Do not just take my word for it.

Go recognize someone.

 

 

Posted in Community | Tagged | 2 Comments

Idera ACE 2016

Idera_new_logo If you have been around the SQL Community long enough, you probably have heard of a software company called Idera.  They make a wide range of useful SQL Server tools.   What you might not know, is that they are also heavily invested into the SQL Community.  One way they invest is with their Idera ACE program which they have re-launched for 2016.

ACE’s, which stands for Advisors & Community Educators, are essentially members of the community who have a passion for sharing their knowledge and helping the community at large.

Idera helps these members pursue their passion by sponsoring their travel to events such as SQL Saturday’s as well as offering guidance on improving soft skills.

Iidera_ace‘m a 2016 Idera ACE

I am humbled to announce that I will be an Idera ACE for 2016.  This is truly an amazing opportunity for me which lets me continue giving back to the community.

As an added benefit, the program will help me to get to events that I might not have otherwise been able to. As most my speaking engagements are done out of my own pocket, having Idera to help offset some of the expense is an amazing gift.

There are a couple of other key benefits that I really like about the program.

  1.  To be part of the program, I don’t have to sell their products.  I will, however, thank Idera in my slides & presentations for sponsoring me. I don’t claim to be an expert in their tools, but I’ll be able to learn more about them.  This program is about the community, not increasing the bottom dollar.
  2. Beta testing.  As an Idera ACE I may get the chance to participate in some beta testing of their tools.  I’ll potentially have the ability to help improve their tools for data professionals everywhere.  I find that very exciting.
  3. I’m hoping to get to incorporate some of their tools in my presentations.  One of their tools in particular, Virtual Database, is a really useful product that I have implemented in a unique way to solve a couple of issues.  I’m looking forward to show that to others and playing with that even more.

Thanks Idera!

Idera is investing in me to further my involvement with the SQL Community and for that I am truly grateful.  This is a fantastic opportunity and I have zero intention of letting you down.

Posted in Community | Tagged , | 2 Comments

I’m Speaking! SQL Saturday #444 – Kansas City

sqlsat444_webThis weekend I’ll be traveling to Kansas City, Missouri for their annual SQL Saturday. Normally, I would just drive to this event.  However, I’m no longer living in Omaha so this year it’s a plane for me.

One of my favorite things about this event is that every year the organizers host a BBQ crawl on the Friday before.  It’s similar to a -“bar crawl“, – hopping from one bar to another, except this is done with BBQ establishments around the Kansas City metro area.  Since I’m a lover of all things BBQ, this is right up my alley and an excellent way to spend a Friday afternoon.

I am really looking forward to seeing friends and partaking in a little BBQ.  However, due to my flight schedule I won’t be able to participate in all of the establishments but I plan on catching up when I get there.

SQL Saturday #444

The schedule is packed full of SQL goodness. So if you like free training, hanging out with other geeks and if you have nothing else planned on Saturday, September 26th, 2015, come on out and get your learn on.

If you want to hear me speak, this is the session that I’m delivering.  I start first thing at 9:00AM so feel free to bring coffee.

Database Continuous Delivery & Your Salvation

DSC_0778Continuous Integration & Delivery isn’t a new concept. Application Developers have been doing it for quite a while and now it’s time for Database Professionals to catch up. Whether you are a database administrator, database developer, or even an application developer, database continuous delivery can help you find your salvation. I’ll show you how to apply these concepts to areas of security, collaboration, testing, support and deployments. We will look at what continuous delivery means, demonstrate some tools that can help you easily get it into place, and dive into why it’s important.

This is a relatively new session for me and I’m really excited to be able to present it.

How Can You Beat FREE Training?

Remember that these events are a FREE day of awesome SQL Server training and professional development.  The only cost to you is if you decide to purchase lunch! Check out the schedule and register.  In today’s economy, how can you afford to pass up FREE training?!?!  The answer is that you can’t.  Go register, get out there and learn.

If you make it out to see my session, make sure to come up and introduce yourself as I’d love to meet you!

See you in Kansas City!!

Posted in Community, Presenting, SQL Saturday | Tagged , , | 1 Comment

I’m Speaking! SQL Saturday #431 – Spartanburg

sqlsat431_web

As I’ve mentioned before, living in Louisville offers up great opportunities to various events within the SQL Community.  This weekend I’ll be traveling down to Spartanburg, South Carolina to speak at SQL Saturday #431.  I am always honored to be chosen to speak and this time isn’t any different.  While it is still a 6 hour drive, I’m looking forward to seeing some of the country side on my trip.

The schedule is packed full of SQL goodness. So if you like free training, hanging out with other geeks and if you have nothing else planned on Saturday, September 26th, 2015, come on out and get your learn on.

If you want to hear me speak, these are the sessions that I’m delivering.  I start first thing at 8:15AM so feel free to bring coffee.  Odds are I’ll have some too.

Social Networking Is Alive!

SocialMediaIsAlive!Social Media is all over the news today. Did you see that on Facebook? Johnny 5 said what on Twitter? Can you believe Susie moved to that company? Do any of those sound familiar? No?  Never heard of Twitter or LinkedIn? Have no fear, this is the session for you!  Social networking can be a very confusing and intimidating place. What makes it even worse, is when you have no clue even where to start.  In this session, we will go over different facets of Social Networking and Media and how you can use them to enhance not only your personal lives but just as importantly, your professional one. For example, did you know you can get help from some of  the top minds in the SQL Server profession by using the #SQLHELP hash tag for free? We will show you how! We’ll be covering that and more using Facebook, LinkedIn and Twitter.

Database Continuous Delivery & Your Salvation

DSC_0778Continuous Integration & Delivery isn’t a new concept. Application Developers have been doing it for quite a while and now it’s time for Database Professionals to catch up. Whether you are a database administrator, database developer, or even an application developer, database continuous delivery can help you find your salvation. I’ll show you how to apply these concepts to areas of security, collaboration, testing, support and deployments. We will look at what continuous delivery means, demonstrate some tools that can help you easily get it into place, and dive into why it’s important.

This is a new session for me and I’m really excited to be able to present it.

FREE Training

Remember that these events are a FREE day of awesome SQL Server training and professional development.  The only cost to you is if you decide to purchase lunch! Check out the schedule and register.  In today’s economy, how can you afford to pass up FREE training?!?!  The answer is that you can’t.  Go register and get out there and learn.

If you make it out either of my sessions, make sure to come up and introduce yourself as I’d love to meet you! I look like a mean DBA but I promise that I’m not.  =)

See you in Spartanburg!

Posted in Presenting, SQL Saturday | Tagged , | 1 Comment

Quick Script: Index Sizes

In the world of performance monitoring, there a number of ways to identify problems. Each method is different and usually, neither way is better than another.

Over the years, I’ve started look at metrics around non-clustered indexes to help find problems.   Once while working at a client site, I was astounded by how they would implement changes so rapidly.  This quick rate of change usually had detrimental effects on the performance of the application. Of course as usual, once the change was in Production, it was difficult to fix things.

One day, I happened to be looking at their flagship application’s database.  The table I was focused on was about 60GB in size.  This, in itself, was not a cause for alarm.  However, the 120GB worth of non-clustered index space was.  Did this mean that we had a performance issue?  Not necessarily.  In my opinion, this meant that we had a potential of having a performance issue.

Here is the common problem that I see.

  1. Ted writes a query for the application.
  2. Ted knows he needs an index so creates a non-clustered index to cover his query.  Awesome!
  3. Paul also writes a query for the application
  4. Paul is just as smart as Ted and so he writes another non-clustered index for his query.
  5. Rinse and Repeat

Shockingly, this occurs more often than you’d think.  Instead of checking to see what indexes are already in place that might cover their respective queries, they just blindly create a new one.

To help identify this potential issue, you could just compare the total number of non-clustered indexes on the table, however in my opinion that doesn’t tell you the whole story.  You don’t know how large those indexes are so your story is not complete.

The script below will give you a better picture.  It compares the heap/clustered index size against the aggregate size of the non-clustered indexes.   The script is configured to identify indexes that are three times larger than table itself.  Your mileage may vary and you can certainly adjust to your liking.

If you run the script against one of your databases and the script alerts you to a potential issue, you will have to further evaluate that particular table.

DISCLAIMER: Do not run code you find on the internet in your production environment without testing it very thoroughly.  Period.  

/***************************************************************
-- Author: John Morehouse
-- Date: April 2015
-- T: @SQLRUS
-- E: john@jmorehouse.com
-- B: http://sqlrus.com

--THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

--IN OTHER WORDS: USE AT YOUR OWN RISK.

--AUTHOR ASSUMES ZERO LIABILITY OR RESPONSIBILITY.

--You may alter this code for your own purposes.
--You may republish altered code as long as you give due credit.
***************************************************************/

;WITH TableIndexes (tableName , datapages, datasize)
	AS (
				SELECT st.name, si.dpages, (CAST(si.dpages as BIGINT) * 8192)/ 1024 as 'dataSize'
				FROM .sys.tables st
						INNER JOIN sys.sysindexes si ON st.object_id = si.id
				WHERE st.type = 'U' -- user tables
						AND si.indid in (0,1)-- Heap or clustered index
	)
	SELECT
			ss.name as 'Schema'
			, st.name as 'Table Name'
			, MAX(ti.datasize) AS 'Table Size(KB)'
			, SUM((CAST(si.dpages as BIGINT)*8192)/1024) AS 'Total NC Index Size(KB)'
			, SUM(si.rowcnt) as 'Total Row Count'
			, COUNT(si.indid) as 'NonClustered Index Count'
			, CASE
					WHEN MAX(ti.datasize*2) < SUM((CAST(si.dpages as BIGINT)*8192 )/1024) THEN 'WARNING'
					ELSE 'OK'
					END AS 'Response'
			FROM sys.tables st
				INNER JOIN sys.sysindexes si on st.object_id = si.id
				INNER JOIN TableIndexes ti ON st.name = ti.tableName
				INNER JOIN sys.schemas ss on st.schema_id = ss.schema_id
		WHERE st.type = 'U' -- user tables
				AND si.indid > 1
		GROUP BY ss.name
					, st.name
		ORDER BY [Schema],[Table Name]

This script can be useful to help identify potential issues.   It is just another tool for your toolbox.

Enjoy!

Posted in General Conversations | 1 Comment

I’m Speaking! SQL Saturday #397 – Omaha

SQLSAT397_web

I recently blogged about the opportunity to speak at that the Omaha SQL Server User group.  In a nutshell, being a co-founder of the group back in 2007, I never presented to the group as a speaker.  In July, I finally got that chance.

Now I have another opportunity.  Just like with the user group, being an organizer of the first two SQL Saturday’s in Omaha (91 & 197), I never submitted to be a presenter.  WithSQL Saturday #397, I finally submitted and two of my sessions were selected.  As such, this weekend I’ll be traveling back to my hometown.  I’m looking forward to seeing old friends, enjoy great food, and of course, presenting to the SQL community.

The schedule is packed with fantastic speakers and the event is being held in a great venue so this is definitely an event you don’t want to miss.  So if you like good people, free training, hanging out with other geeks, come on out to Mammel Hall on Saturday, August 15th, 2015.  Join us and learn something.

Here are the abstracts for my sessions.  Please do come out and see me!

Social Networking Is Alive!

SocialMediaIsAlive!Social Media is all over the news today. Did you see that on Facebook? Johnny 5 said what on Twitter? Can you believe Susie moved to that company? Do any of those sound familiar? No?  Never heard of Twitter or LinkedIn? Have no fear, this is the session for you!  Social networking can be a very confusing and intimidating place. What makes it even worse, is when you have no clue even where to start.  In this session, we will go over different facets of Social Networking and Media and how you can use them to enhance not only your personal lives but just as importantly, your professional one. For example, did you know you can get help from some of  the top minds in the SQL Server profession by using the #SQLHELP hash tag for free? We will show you how! We’ll be covering that and more using Facebook, LinkedIn and Twitter.

10 Things Every DBA Should Know!

Are you new to the world of Databases? Are you a developer wanting to improve your SQL Skills? If you answered ‘Yes’ to either of those questions, then this is the session for you! John will be reviewing things that he’s seen in his experiences working with databases that every DBA should know and understand. He will demonstrate and\or explain every day things like Auto Shrink, SELECT *, Index Basics and 7 others! You will leave this session walking away with knowledge you can implement right away.

FREE Training

Remember that this event is a FREE day of awesome SQL Server training and professional development.  The only cost to you is if you decide to purchase lunch! Check out the schedule and register.  In today’s economy, how can you afford to pass up FREE training?!?!

If you make it out either of my sessions, make sure to come up and introduce yourself as I’d love to meet you! I look like a mean DBA but I promise that I’m not.  =)

See you in Omaha!

Posted in Presenting, SQL Saturday | Tagged , | Leave a comment

SQL Saturday Speaker Marketing – With Powershell

pass_marketing_2015

If you follow the Twitter account for SQL PASS, you probably noticed that they are actively promoting individual Summit 2015 speakers.  I think this is a fantastic marketing strategy not only for the individual speakers but also for the Summit itself.

I’m currently involved with organizing a SQL Saturday event (SQL Saturday #403 – Louisville).  With these events, I am always on the lookout for ways to make our event even better.  When I saw PASS doing this type of marketing, I knew that we had to do it for our event.

Now, if you look at the event schedule, we have 36 speakers.  I’ll admit it would be relatively easy to copy & paste things together for a tweet  How about those SQL Saturday’s that have 75 speakers like Atlanta?  With 75 speakers, the copy & paste process would become unwieldy quickly.

sqlsat_xml_feed_exampleOne of the benefits of the SQL Saturday website is that they offer a XML feed for every event.  This XML feed provides a number of useful data elements. These elements include speakers, sessions, and the event itself.  Given that I like to make things suck less, I wanted to find a way to dynamically generate Twitter content using this XML feed.  Once I have the content, then I can schedule them appropriately in my favorite social media application.

Enter Powershell.  Stage left.

Powershell has many abilities.  One of those is the ability to consume and manipulate XML data.  This is a perfect solution to generate what I need.  I modified the format of the tweet from the one that PASS was using.  In short, I wanted the script to:

  • Print out the length of the tweet so that adjustments could be made if longer than 140 characters
  • Include a link to each individual session
  • Automatically shorten the session URL
  • Include session title
  • Automatically use the appropriate event hash tag, namely the number or the name
  • If the speaker included their Twitter handle, include that as well
  • Output the results either to the screen or to a CSV file

Bit.ly URL Shorting

posh_tweet_1First, let’s get setup to shorten the session URL.  There are a number of services that can do this, however I choose to use Bit.ly.  For no specific reason aside from, I was able to find examples of how to communicate with their service on the internet.   In order to do this, I had to create an account at Bit.ly and generate an application token.  This token will allow the script to automatically pass in the long URL and retrieve the shortened version.

It is worth noting that you should not publicize the token as someone could use it to impersonate you when communicating with the service.

Let’s dive into the script!

The first thing that we are going to do in the script is declare some variables that will be used later in the script. We will also create a function to shorten the URL. This function will be called as we iterate through the XML data.

#Tweet Format
#Speaker [name] presents [title] [SessionURL} /cc [twitter handle] [event hash tag]

$eventNum = "403"
$OAuthToken =  "[bit.ly token goes here]"
$outputfile = "c:\temp\sqlsat$($eventnum)_tweets.csv"
$outtofile = 1

#declare our array to hold our tweets
$tweets = @()

# used to shorten the session URL for a better character count for Twitter
# internals borrowed from http://powershellnotebook.com/2014/10/29/powershell-shorten-links-with-the-bit-ly-api/
# function wrapper was written by John Morehouse

function Get-ShortURL{
    Param([string]$longURL, 
            [string]$OAuthToken)

  # Make the call
  $MyURL=Invoke-WebRequest `
    -Uri https://api-ssl.bitly.com/v3/shorten `
    -Body @{access_token=$OAuthToken;longURL=$LongURL} `
    -Method Get

  #Get the elements from the returned JSON 
  $MyURLjson = $MyURL.Content | convertfrom-json
   
  # Print out the shortened URL 
  write-output $MyURLjson.data.url 
}   

Given that we now have the function available, we can start to parse the XML data. To do this we will use the Invoke-webrequest cmdlet. The output from the cmdlet will put the results into the $xdoc object.

#let's get the XML from the SQL Saturday website
$xdoc = Invoke-WebRequest -Uri "http://www.sqlsaturday.com/eventxml.aspx?sat=$eventNum" -UseBasicParsing

If you examine the $xdoc object, you will notice that there are a number of elements that you can use. For this purpose, we will only need certain elements from the Speaker and Event objects.

#we only need a subset of each node of the XML, mainly the speakers and the sessions
$speakers = $xdoc.GuidebookXML.speakers.speaker | select importid, name, twitter
$sessions = $xdoc.GuidebookXML.events.event | select importID, title

To my knowledge there isn’t any easy way to “join” two Powershell objects together so instead I opted to use a ForEach loop to do this (if someone knows a better method, please share, I would love to know).  I start with the $speakers object and for every speaker within the object, we need to get their respective session from the $sessions object. The $sessions object will be piped into the Where-Object cmdlet using the criteria that the session import id is equal to the speaker import ID. In SQL terms, this would be the foreign key between to the two objects.

foreach ($speaker in $speakers){
$session = $sessions | where-object {$_.importid -eq $speaker.importID}

Now we have the speaker and their respective session, we need to clean up some data. The SQL Saturday website does not appear to sanitize the Twitter feed information. This means that speakers can enter a range of values for their Twitter handle. Things like “http://twitter.com/sqlrus”, “sqlrus”, or “@sqlrus”.

Another issue I ran into is with the Title. The site stores the title along with ASCII encoded characters. For example, ampersands appear as “&amp” and apostrophes as “#39″. Since we want the tweet to be as clean as possible, we will need to adjust the title for those characters.

#santize the data some
#if the twitter value is less than 2, just set it to a blank value
IF ($speaker.twitter.Length -le 2){
$twitter = ""
}
#if the twitter value is larger than 1 and begins with https, replace it with an @
ELSEIF (($i.twitter.Length -gt 1 ) -and ($i.twitter.substring(0,5) -eq "https")){
$twitter = "/cc " + $i.twitter.Replace("https://twitter.com/","@")
}
#if the twitter value is larger than 1 and begins with http, replace it with an @
ELSEIF (($i.twitter.Length -gt 1 ) -and ($i.twitter.substring(0,4) -eq "http")){
$twitter = "/cc " + $i.twitter.Replace("http://twitter.com/","@")
}
#if the first character is NOT an @, add one
ELSEIF ($i.twitter.substring(0,1) -ne "@"){
$twitter = "/cc @" + $i.twitter
}
#else build in the /cc string
ELSE {$twitter = "/cc " + $i.twitter}

#clean up the title if there are any ASCII encoded characters
$title = $session.title.TrimEnd().replace("#39;","'").replace("amp;","&")

At this point, we’ve cleaned up the Twitter information and the title. Now we are ready to get the shortened URL. Since each session has a unique ID for each event, it is pretty simple to dynamically build out the long URL. We will then pass the long URL along with the OAuth security token into the function.

#get the short URL
$longurl = "http://sqlsaturday.com/$eventNum/Sessions/Details.aspx?sid=" +$session.importID
$shortURL = Get-ShortURL -longURL $longURL -OAuthToken $OAuthToken

Now we can bring it all together.  This will insert every individual tweet into our array.

#bring it all together and put it in the array
  $tweets += "Speaker " + $speaker.name + " presents `"" + $title + "`" " + $shortURL + " " + $twitter + " " + $xdoc.GuidebookXML.guide.twitterHashtag

Our array is now fully populated with all of the dynamically created tweets.  Since I wanted the ability to either output the contents to the screen or a CSV, we have to do some conditional logic.  We also provide the array some formatting so that things look nice and clean.

#provide some formatting to our array
$format = @{Label="Length";Expression={$_.Length}}, @{Expression={$_};Label = "Tweet"}

#if the $outtofile variable is 1, export it to CSV.  If not, pump it to the screen.  
If ($outtofile -eq 1){
    $tweets | select-object -Property $format  | export-csv $outputfile
  } else {
    $tweets | select-object -Property $format | format-table -AutoSize
  }

The output to the screen looks like this:
posh_tweet_2

If I had wanted to output the results to a CSV file, then it would look like this:posh_tweet_5

In our case, we are using the CSV to track when each tweet goes out as well as who is sending it out.

Final Product

Now that I have the tweets created, all I have to do now is to schedule them accordingly.  I choose to use Buffer because the interface is clean and simple.  If you have a free account, you are limited to 10 tweets in the queue so you will have to manage it accordingly.

Once you have created a Buffer account, you will need to link it to your Twitter account.  The process is simple to do.  After linking the accounts, you can start to add tweets to the queue.

As you can see below, I’ve got one ready to be added for Bill Fellows.    This particular tweet will only be going to my Twitter feed.  However, my Buffer account is linked to my Twitter feed, my LinkedIn Profile and my Facebook account so I could also publish the content there as well.

posh_tweet_3

posh_tweet_4I just simply add it to the queue and Buffer does the rest! You can also schedule it for a specific date and time.  Whether it’s been scheduled or just in the queue, at the appropriate time, Buffer will deliver the tweet for you! You might notice that Buffer kindly convert the short URL to their own version.  You might have this same experience using your own social media tool so just something to be aware of.

Summary

In today’s world, we want our events to be as successful as possible.  With the number of SQL Saturday’s that are available almost every weekend, every little bit of marketing helps to drawn in attendees.  Not only will our speakers get more press time, the event itself will too.   Hopefully a script like this will make things easier.

You can download the entire script here.

Enjoy!

Posted in General Conversations, SQL Saturday | Tagged , | 6 Comments

I’m Speaking! SQL Saturday #402 – Indianapolis

SQLSAT402_webOne of benefits, among several, in moving to Kentucky is the close proximity to several SQL Saturday events.  I am honored to have been selected to speak at SQL Saturday #402 in Indianapolis, Indiana. Indianapolis is a great town and I’m looking forward to attending my 4th SQL Saturday of 2015 there.  Thankfully it is only a few hours north of Louisville,  so I don’t have to fly this time and it’s an easy drive.

The schedule is packed full of SQL goodness. So if you like free training, hanging out with other geeks and if you have nothing else planned on Saturday, August 8th, 2015, come on out and get your learn on.  Join us and learn something.

Oh, and I’m speaking!

SQL Server Databaseology: A Deep Dive Into Database Internals

Have you ever taken apart a toaster or an alarm clock just to see how it worked? Ever wondered how that database actually functions at the record level, behind the scenes? SQL Server Databaseology is the study of SQL Server databases and their structures down to the very core of the records themselves. In this session, we will explore some of the deep inner workings of a SQL Server database at the record and page level.  You will walk away with a better understanding of how SQL Server stores data and that knowledge that will allow you to build better and faster databases.

If you do attend, please feel free to introduce yourself. While I can’t attest to the other speakers, I know that I don’t bite!

See you in Indy!

Posted in Presenting, SQL Saturday | Tagged , , , | Leave a comment

I’m Speaking! Edmonton SQL Server User Group

PASS Chapter LogoI am honored to be speaking at the Edmonton SQL Server User Group.  I always find it humbling to be asked to present and I thank the group for the opportunity.  My travel budget will not allow for me to be onsite for this meeting, so this will be a remote presentation.

If you are lucky enough to be in the area, here are the location details:

CWB Canadian Room
Concourse Level (lower Level)
Canadian Wester Bank Building
10303- Jasper Ave
Edmonton , Alberta T5J 3X6
CA

The meeting will be on Thursday, July 23th, 2015 @ 6PM (MDT).

SQL Server Databaseology: A Deep Dive Into Database Internals

Have you ever taken apart a toaster or an alarm clock just to see how it worked? Ever wondered how that database actually functions at the record level, behind the scenes? SQL Server Databaseology is the study of SQL Server databases and their structures down to the very core of the records themselves. In this session, we will explore some of the deep inner workings of a SQL Server database at the record and page level.  You will walk away with a better understanding of how SQL Server stores data and that knowledge that will allow you to build better and faster databases.

Please make sure to RSVP so that the organizers have an accurate head count!

See you Thursday!

 

Posted in General Conversations | Tagged | Leave a comment