Paw Prints

Thursday, September 8, 2016

SQL Server St. Louisans UNITE! SQL Saturday is nigh.

Every once in a while, an opportunity rolls into town that all SQL Server DBAs and Developers should attend just to high five each other, if not to learn something new. SQL Saturday is once again in St. Louis on September 9th, and if you haven’t signed up to go, there’s still time! Follow the link below to sign up and see some great speakers like Kathi Kellenberger, or just to know that you are not alone in our fair city. SQL Saturday 542

Woof!

Friday, November 21, 2014

SQL Poetry Friday #4

Hello and welcome again to SQL Poetry Friday. I sadly do not have a code poem today, and it turns out that the poetry is suitable to be sung to America's classic hit "A Horse with No Name". It goes like this:

Well I've built me a table
With no column names,
where results never
came out the same.
In the sandbox, they won't
remember your name
for you're not in production
to cause them all pain...

Please come back next week for another exciting parlance into prose.

Woof woof!
Jason

Thursday, November 20, 2014

Count (DISTINCT) saved my brain.

I'm building a "dashboard" which counts up objects in a time period. It happens that the objects have parts (that is to say 'part A', 'part B', etc.) that reside in a separate table. When I would join the parts table into the object table, all of the sudden my count for each object would increase, totally blowing my mind! Using Count(DISTINCT object) brought me back to my original counts and my brain was saved from the pounding of frustration.

Here’s to you, Count(DISTINCT), a real database hero!

Woof woof!
Jason

Tuesday, November 18, 2014

Hour of Code coming December 8-12!

I was notified over the weekend that Kahn Academy is facilitating the Hour of Code for kids the week of 12/8-12/12. Hour of Code introduces kids to some aspect of computer programming to help foster interest in future projects. It sounds like the perfect opportunity to introduce SQL to the next generation.  Yes, you read that right, they have a setup for SQL (as well as javascript and html/css, but I’m partial to the former)!!! Please consider getting involved with your kids or kids in your area, and make plans with the site below.



Woof woof!

Jason

Friday, November 14, 2014

SQL Poetry Friday #3

Hey, poetry lovers! This was a fun little ditty that I created out of Pinal Dave's search for column names in a particular database by table.  I'll post the code and my own results from my master database.

SELECT
c.name AS 'When I Am'
FROM sys.tables t
INNER JOIN sys.columns c 
ON t.OBJECT_ID = c.OBJECTID
WHERE c.name LIKE 'l%'

Results:


If your mind makes the leap like mine did reading quickly down the column, I read it as "When I am low, I start; last run."  Try for yourself and see how your database is feeling.

Woof, woof!
Jason

Wednesday, November 12, 2014

Ordering days of the week

This is a small problem that I’m sure has been solved in a number of different ways, but here is my own take on coding the days of the week in order. Having to categorize information by days can be difficult, as of course, it’s not a list that you can use ORDER BY. Here’s my code:

CREATE TABLE #TMP (ID INT, ADAY VARCHAR(20))
INSERT INTO #TMP(ID, ADAY)
              VALUES (1, 'Sunday'),
              (2, 'Monday'),
              (3, 'Tuesday'),
              (4, 'Wednesday'),
              (5, 'Thursday'),
              (6, 'Friday'),
              (7, 'Saturday')
SELECT
       ADAY
FROM #TMP
ORDER BY ID
DROP TABLE #TMP
Woof woof!
Jason

Monday, November 10, 2014

Building Process and Strategy

Mondays are my day to try and expound or extol or ex-something to shed more light on SQL and it’s pros and cons.  This may be a tougher situation to tackle on a Monday than a sum up of the week, as my weekends are usually free of SQL.  I will say this, however.  I’ve been listening to a LOT of books (I listen to audiobooks as I hardly ever set any time apart to read, so listening is how I have to feed the rest of my head), and many of the business books I’ve been pushing through have talked about forming strategies and then sticking to them.  I’ve been trying to apply this to query and report building, as I have always tended to more of a shotgun approach rather than a rifle; a scattered, hope something sticks pursuit rather than a narrow, step by step.  It’s a detriment that I’ve been working on probably for the last 12 months.  Agile development practices have helped me get started, especially giving myself a 3 point to do list every workday to push towards, but I really need to put something into templates or systemization of reports.  I’ll keep you posted on how this continues to develop, as it is a process I think we all work towards (or at least us hounds who doggedly pursue bigger better things).  Keep digging until that bone is firmly in teeth, my fellow hounds!

Woof woof,
Jason