What’s in a (team) name?

Albany once had a CBA (Continental Basketball Association) team, the Albany Patroons. They were a competitive team that had some pretty good history behind it, having produced coaches such as Phil Jackson and Bill Musselman.  I told myself that I had to go catch a game sometime.

It never happened. The very next year (after I proclaimed that I had to go to a game), the team changed their name to the Capital Region Pontiacs, after the local Pontiac dealerships.  The name change turned me off completely. I said to myself, “no way am I supporting that team.” I never made it to a game.

I liked the “Albany Patroons” name.  Wikipedia defines “patroon” as “a landholder with manorial rights to large tracts of land in the 17th century Dutch colony of New Netherland in North America.”  It was reflective of the region’s Dutch heritage, so it was appropriate.  “Capital Region Pontiacs,” on the other hand, pandered to car dealerships.  What does that have to do with Albany?!?  The new name put me off so much that I vowed never to attend a game.  As it turned out, the team ended up moving (or folding — I don’t remember which).  As far as I was concerned, good riddance.

This isn’t the only time that a team turned me off because of a name change.  I stopped rooting for the NY/NJ MetroStars when they became Red Bull New York.  (I now consider myself a fan of NYCFC.)  There was once a hockey team, the Albany Choppers (named after the local Price Chopper chain of supermarkets).  I never felt any affiliation with them.  Albany also had an independent minor league baseball team, the Diamond Dogs, and a hockey team, the River Rats.  To me, those didn’t sound like names worthy of professional sports teams in the Capital Region; rather, they sounded like gimmicks.  Although I went to a few games, I was never enamored with either team simply because of the names.  To this day, I do not have — nor do I have any desire to own — a single piece of Diamond Dogs or River Rats gear.  Today, the Capital District is home to the Tri-City ValleyCats (a single-A New York-Penn League farm team for the Houston Astros) and the Albany Devils (an AHL team affiliated with the New Jersey Devils).  To me, those names sound professional, not gimmicky, and I am more prone to support them.  (As the baseball fan that I am, I do regularly attend ValleyCats games, and I do have a few ValleyCats shirts and baseball caps.)

I don’t know if any statistics exist as to how fans react to team nicknames — whether it’s by attendance, paraphernalia sales, or what have you.  I would be curious as to what they are.  If I had to venture a guess — and that’s all this is — I’d suspect that a team’s name could affect those stats.

So for those of you who are involved with sports marketing, take heed.  What’s in a name?  Possibly everything.

Installing a Baseball Database

Earlier, I wrote about how I installed SQL Server 2016 on my machine.  In this article, I talk about creating and populating a baseball database.

I am a huge baseball fan.  I started following the New York Yankees when I was about 12.  (In an act that is likely anathema to religious fanatics, I married a Boston Red Sox fan; during baseball season, one of us — metaphorically speaking — ends up sleeping on the couch!)  I have been known to schedule vacations around Major League Baseball schedules.  I believe that Cooperstown is Mecca.

Why, you might ask, is this relevant to installing SQL Server?  Because I believe that one of the best ways to learn something is to have fun while you’re doing it.  So in this implementation, instead of installing NorthWind Traders or AdventureWorks (the standard practice databases used by SQL Server enthusiasts everywhere), I will instead install a copy of Sean Lahman’s baseball database.  (At the time of this article, the most recent version goes to and includes the 2015 baseball season.)

I should note that this isn’t to say NorthWind or AdventureWorks isn’t fun; rather, baseball is something about which I’m passionate, and is more likely to keep my attention.  At some point, I’ll likely install NorthWind or AdventureWorks as well, as many SQL references and guides refer to them.

I downloaded the most recent SQL version from Sean Lahman’s website, which left me with a .ZIP file.  Inside the file, I found a MSSQLMASTER.SQL file (you’ll find it in \mysql core\core\) that I extracted from the .ZIP file.  I opened the file with SSMS.

The first thing I noticed was that it created a database called “stats.”  I did not want to use this as my database name, so I first replaced all instances of “stats’ with “baseball”.  Once this was done, I ran the database build query.

Unfortunately, it would not be that easy.  The query file is very large.  When I ran the query, I received the following message.

SSMSOutOfMemory

Okay.  It has a lot of rows to insert (the data includes over a hundred years of statistics, after all).  Instead, I opted for just creating the database and tables.  However, even that proved to be problematic.

SQLBaseballBuildErrors

“Okay,” I said to myself, “what’s going on now?”

First, I had a permission issue to deal with (this doesn’t appear in the above log; I neglected to include that message).  I looked for the C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA folder.  When I tried to open it, I got a message saying that I had insufficient permissions to open it.  “What?” I said, “this is my own machine, and I’m the administrator!”  However, it also prompted me asking whether I wanted to open it.  I answered yes.  Once I did, I tried running the query again, and the permission error seemed to disappear.

However, that’s when I got the errors shown above.

That’s when I noticed that the filename references MSSQL11.  My database path includes MSSQL13.  Okay.  I changed the path in the filename from MSSQL11 to MSSQL13 and reran the query.  This time, it ran successfully.

I did notice one thing about the table infrastructure.  All columns were defined as NULL, which indicated to me that there were no unique indices or primary keys defined.  All tables would be heaps.  That’s something that I’d need to fix, but that was likely another project for another time.  For now, I was more concerned about building the database infrastructure and inserting the data.

Once my database and tables were built, I commented out the CREATE DATABASE and CREATE TABLE lines from the code, leaving only the INSERT commands.  Just for grins, I tried running the query again, and once again got the “insufficient memory” message.  Okay, no dice.  How was I going to get around this?  I suppose I could’ve selected and run the INSERT queries piecemeal, but that was going to be a long and painful process.

I ran a Google search, and came across my old friend, StackOverflow, where I found this entry.  So I tried the command line, substituting my database name and SQL filename (including the path).

sqlcmd -d baseball -i Downloads\mssqlmaster.sql

Here’s what I got:

sqlcmd: Error: Connection failure. SQL Native Client is not 
installed correctly. To correct this, run SQL Server Setup.

Interesting.  I went to look up SQL Server 2016 Native Client, and found this.  So SQL Server 2016 does not include Native Client.  So, I tried to download and install Native Client.

Of course, nothing ever goes as planned.  I got this message.

NativeClientErrorMsg

So, I went into my Settings to check my Native Client.  It told me that 2012 Native Client was already installed.

After Google-searching my error messages, I realized that I had SQL Server 2008 Express installed, and my SQLCMD was likely getting confused between versions.  That was likely the culprit.  So I went ahead and uninstalled SQL Server 2008, and tried my SQLCMD command line again.  This time, the SQLCMD did not give me any errors, and my command prompt started scrolling with the familiar “(1 rows affected)” message that appears when SQL Server inserts rows into tables.  The script finished without any problem.

Once the script finished, I ran a query to see if my data had made it into the tables.

BattingQuery

So it appears that we are good to go!  Our baseball database is populated!

I now have a baseball database with which I can play to my heart’s content.  I’ll be using this to practice my SQL skills — and ‘blog about my adventures (or misadventures, as the case may be) as I do so.