T-SQL Tuesday #030 – A DBA’s Ethics

Invitation from Chris Shaw.

I was in the first few months of my second database administrator job when the CTO told me that I needed to give the CFO direct table access into the database that I had designed.  Not 3 months later we were having a company meeting so the executive staff could explain to the company that the CFO had stolen our client list and was out luring our customers away.  Sound like a security issue? Not the way that I see it.

I had an ethics issue on my hands.   From that day in 1997 I have always had my eye out for ethical issues, and more importantly looking for ways we can police ourselves.  It does not take long for a new database professional to see that when you have access to data that there is going to be sensitive data in there somewhere.  The obvious ones are the HR databases, or the financial databases that reside on our SQL Servers.  But there are so many more areas that we need to look before we can get a good handle on how to solve these ethical dilemmas. Take a look at something that I posted a while back that threatened the security of the United States.  I cannot imagine that it would take long for an ethical person to say, “Really?”

A few months ago I had to get a security clearance, and pass the Security + certification so I could do a short contract with the Air Force.  As I was going over study material in a book I was supplied, I ran across a couple of short notes about ethics.  I followed a link or two and I ended up here.  When I first started to look at the list of ethics that they had listed, I was really impressed.  As I got deeper into what they were saying I became a bit concerned, however. The company that produced this is a corporation, not an organization that has the best interests for the industry as a primary goal.  I don’t believe there is anything wrong with being a for-profit, I know I work for one, and well, as an individual I am for-profit.  My issues with the code is the code itself appears to be pointed and making the company a profit, at least it does to me.  If that is the reason they sponsored the Code of Ethics, then well they violate their own ethics when they say:

“I will not advance private interests at the expense of end users, colleagues, or my employer“.

So here is where that leaves us:

For this month’s t-sql Tuesday question I wanted to highlight the need for Ethics in our industry.  Don’t consumers and business owners have to trust someone at some time with their data?  This month, take time to participate by talking about DBA ethics.  I really hope to see someone address topics such as:

         Should we have an ethics statement?

         Have ethics issues impacted you? What did you do about it?

         Security Audits: how do you police what you and others are doing in the database?

         Does a Code of Ethics mean anything to anyone? How do we as a community enforce a Code of Ethics?

         Do you have an issue with this Code of Ethics?

         What do you believe our Code of Ethics should say if we the SQL Server Community have one?

Have fun, but take the time to dig deep and do some real soul searching.  I know with large number of really smart professionals that we have in our community we can think of something.  I will do up a summary once I have returned from my trip that week, but to be honest I hope this discussion goes on long after May 8th.

As with each of the T-SQL installments I ask that you follow some basic rules.

T-SQL Tuesday #029 – Let’s have a SQL Server 2012 party

Invitation from Nigel Sammy.

Yay!! It’s time for T-SQL Tuesday and this month I am hosting the party. I had another topic in mind when I asked to be a host but since the RTM occurred in March I thought it would be best to pick a topic focusing on SQL Server 2012!

I have been playing around with 2012 for some months now and I know for a fact that I don’t know all the new or improved features. As for the features that I actually do know, I cannot say that I am 100% sure that I fully understand all of the benefits that they provide. I don’t think that I am the only person who feels this way so I decided to pick a topic to help improve everyone knowledge of SQL Server 2012!

This month’s topic is: What do you think is a useful feature of SQL Server 2012? 

The feature can be a new or an improved feature. I deliberately did not use the word ‘favorite’ to reduce the chance of multiple posts focusing on the same topic. I also deliberately used the word ‘useful’ to encourage bloggers to give detailed use cases and real-world examples. Remember these posts are to share knowledge and benefit the SQL community so if you want to ‘gain access to the VIP room at the After Party‘ then be the blogger who wrote about a useful feature that no one else covered.

T-SQL Tuesday #028 – Jack of All Trades or Master of None

Invitation and summary from Argenis Fernandez.

I’ve lost count of how many times I’ve heard that phrase.

Are you specialized? On something? Or anything at all? Has that been a good or a bad thing? Why?

Are you the SQL guy at work? Or the one who does everything?

Do you code? And configure wireless routers at work also?

If you had to pick one thing to specialize on, what would it be?

Over the course of my career I’ve worn many many hats. I always felt I was doing fine, had a stable job, but wasn’t quite fond of my prospects for the future. Then a friend said that I should focus on one thing and be the best at it. And while I’m most certainly NOT the best at it, I’ve gotten progressively better on it, to the degree that I’ve been called an ‘Expert’ by some (hate that word!) – I’d rather be called ‘knowledgeable’. My career took off like a rocket after I specialized, and certainly choosing to focus on one thing (SQL Server, in my case) has been one of the best decisions I’ve ever made. I’ve also been careful of not forgetting my roots as a SysAdmin – and always try to keep up with changes on the Windows/SAN/Networking front, but not with the same level of intensity.

So, in this installment of T-SQL Tuesday I’d like to ask you to blog about your experience. Tell us why you specialized, or why you’d like to specialize. If you don’t think that specialization is a good thing, tell us why. Discuss. Argue your point(s).

T-SQL Tuesday #027 – Invitation to The Big Data Valentine’s Edition

Invitation and roundup from Steve Jones.

Big Data

godivaThe party falls on Valentine’s Day this month, and I thought a little notice would let you get your post done early, and then spend the day with your loved ones

Since the media has a love affair with Big Data right now, I thought this would make an interesting topic. Data is the lifeblood of our careers and of many organizations. Slowly governments, companies, and individuals are becoming aware of just how important data is to us, and as they do, they want more of it. More storage, more access, and more analysis.

That creates challenges for us as data professionals. We will have to learn to better manipulate, aggregate, summarize, and handle larger volumes of data in the future. I think this means we will have lots of employment in this area, and it means tremendous opportunity for those that learn to work with data well.

This month I want to hear what big data problems you’ve solved, or interesting ways of working with big data, challenges that you struggle with, or cool hardware tricks that mask the problems in your code.

Think big, and let us know how you work with Big Data.

T-SQL Tuesday #026 – Second Chances

Invitation from David Howard. (site gone, but invitation here).

Every new year brings with it a fresh start, a second chance to do things differently.  In the spirit of second chances, for this month’s T-SQL Tuesday, please pick any one of the previous 25 T-SQL Tuesday topics and write about it. You can choose one of the topics you participated in before, or you can choose one you missed for some reason. 

Maybe you were just too busy when Michael Swart invited everyone to write about indexes. Or maybe you weren’t quite happy with the CTE post you came up with when Bob Pusateri hosted.  Or maybe you have a ton to say about IO, but like me, you didn’t know anything about T-SQL Tuesday until long after Mike Walsh’s month.

Well now is your chance to set things straight!  In fact, if you like, you can even throw down a few resolutions for the new year (see Jen McCown’s #14).  And if this is your first T-SQL Tuesday, just pick a topic and jump in.

Wrap Up

Thank you everyone who participated in T-SQL Tuesday #026! I really enjoyed hosting and reading all of the contributions. Thanks also to Adam Machanic (blog | @AdamMachanic) for starting this monthly event and for allowing me to run this show this time around.

We had 14 posts, covering about 10 different topics depending on how you count. Here’s a brief summary of them all, in the order received.

1. The first post was from Rob Farley (blog | @rob_farley), a T-SQL Tuesday regular and one of my favorite SQL bloggers. He writes about a limitation of using APPLY when dealing with working calculations which he had written about in an earlier post.
Original T-SQL Tuesday 17 / 25

2. Sebastian Meine (blog | @sqlity) delves into some index internals, explaining SQL Server’s B+ tree structure, and how that is different from a standard B-Tree.
Original T-SQL Tuesday 10 / 11

3. Steve Wales (blog | @walessj) tells a tale of T-SQL Tuesday, managing to incorporate references to all the past 25 events – very creative! He also let us in on his 2012 resolutions, which match up with mine in a lot of ways (except for that one with the “O” word :) )
Original T-SQL Tuesday 14

4. After a brief intro in French and some cool New Year’s Eve images, Jason Brimhall (blog@sqlrnnr) covers several type of ways to perform JOINs on tables where a bitmask is applied to an id field.
Original T-SQL Tuesday 23

5. I enjoyed reading Jason Grobe’s (blog | @sqlmentalresolutions, which cover both personal, professional and community oriented goals. More power to you Jason!
Original T-SQL Tuesday 14

6. Nancy Hidy Wilson (blog | @NancyHidyWilson) extols the virtues of her favorite “new” features in SQL 2008 R2: CMS (Central Management Server) and PBM (Policy Based Management).
Original T-SQL Tuesday 7

7. Mike Fal (blog | @Mike_Fal) shows a trick for dynamically generating a restore command using the output of a RESTORE FILELISTONLY command. Very cool.
Original T-SQL Tuesday 25

8. Robert Pearl (blog | @PearlKnows) shows us the “best of all worlds” with a very comprehensive query against the missing index DMVs.
Original T-SQL Tuesday 25

9. Aaron Bertrand (blog | @AaronBertrand) shares some work he did at a previous job to implement customer time zone logic at the database layer simplifying the presentation to the application.
Original T-SQL Tuesday 22

10. Steve Jones (blog | @way0utwest) discusses a topic I run into all the time reviewing code, how to deal with the time component of a date range correctly.
Original T-SQL Tuesday 1

11. Colleen Morrow (blog | @ClevelandDBA) shares some of her new year’s resolutionswith us as well as her strategy for keeping up with them. I really like her idea of breaking them down into monthly chunks so they don’t seem so daunting.
Original T-SQL Tuesday 14

12. My (blog | @daveh0ward) contribution was a brief discussion of what I think experienced DBA’s provide to an organization.
Original T-SQL Tuesday 12

13. Carlos Bossy (blog | @carlosbossy) covers a topic I’m excited to learn more about: the new windowing functions in SQL 2012, specifically in dealing with sliding aggregations.
Original T-SQL Tuesday 16

14. Ricardo Leka (blog | @bigleka) shares an improvement to a previous SQLCMD script he wrote to allow for creating a database mirror in a more dynamic way.
Original T-SQL Tuesday 25

Thanks again to everyone who contributed! See you next month.

2011 T-SQL Tuesdays

T-SQL Tuesday #025 – Invitation to Share Your Tricks

Invitation and followup from Allen White

It doesn’t seem that long ago that having cool little tidbits of information about SQL Server made a huge difference in how effective you could be. Well, that’s still true, but let me give you an example.

SELECT name FROM sysobjects WHERE sysstat & 4 > 0

In the early days of SQL Server, this was the way to pull a list of the names of all the stored procedures in your database. The 4 bit in the sysstat column represented stored procedures. (1 represented user tables and 2 represented view, as I recall, so changing the WHERE clause to read WHERE sysstat & 7 > 0 returned all tables, views and stored procedures.)

As SQL Server has evolved, Microsoft has made it easier to query the metadata to determine what objects existed, adding columns that helped (like ‘Type’ in this case), catalog views, Dynamic Management Objects, etc.

So, the challenge for this month’s T-SQL Tuesday is: What T-SQL tricks do you use today to make your job easier? (Notice I didn’t say PowerShell – I have a bunch of those now, but this is T-SQL Tuesday, not PowerShell Tuesday.)

T-SQL Tuesday #024 – Prox ‘n’ Funx

Invitation and roundup from Brad Shulz.

You are hereby invited to this month’s T-SQL Tuesday #024, which will take place on November 8, 2011.

So, all you T-SQL Bloggers out there, please join the blog party and write up something revolving around this month’s topic: Prox ‘n’ Funx (which is just a coo-ul way of referring to Procedures and Functions).

This topic covers a lot of ground, so there’s a myriad of possibilities in what you can write about. You could discuss a really cool stored procedure or function that you wrote. You could write about a Dynamic Management Function that you can’t live without… or perhaps write about some of the new functions that are coming in SQL2012. How about limitations or “gotchas” or performance issues in working with procedures and functions? And on and on and on…

T-SQL Tuesday #023 – Joins

Invitation and roundup from Stuart Ainsworth.

Topic d’jour?  JOINS (I’m in a fundamentals mood lately).  Note that I also like creative and esoteric posts, so if you can find a way to apply SQL as a metaphorical language for community activity, I’ll read it and enjoy it.  If you just want to tell me in a simple fashion the difference between a HASH and MERGE join, I’m cool with that, too.

T-SQL Tuesday #022 – Data Presentation

Invitation and round-up from Robert Pearl.

On to this month’s Topic

What I have described above may be some behind-the-scenes details, but nevertheless, I packaged it in such a way that would provide entertainment (maybe ridicule?) to the reader at large.  This was my presentation to the reader.

Therefore, the topic of this month’s T-SQL Tuesday is, “data-presentation” Or put better, formatting data for presentation to the end-user.

We may be the developers, and techno-geeks behind the code, whether simple, advanced, spaghetti, or otherwise.  But, the data the user sees is most critical.  The query output, the report, or data presentation, must be absolutely formatted in such a way that is easily understandable and readable by the end-user.  The end-user can be the boss, supervisor, department head, the analyst, employees, or customers.  And they must be the ones we cater our queries to!

It helps a lot, if we can simplify our code too.    For example, when doing comparative analysis of the dataset results returned by a query, it makes it completely understandable if the output includes a percentage column.  While for the end-user, it may be hard to digest milliseconds, megabytes, totals, and other assorted aggregated data, everyone can easily comprehend when something is X% percentage out of the whole.

For example, with the advent of Common Table Expressions (CTE), this makes it a whole lot easier to return all the data rows, along with the percentage in one single T-SQL pass.

Therefore, I am inviting you all to write about “data presentation” to the user.   This can be in the form of T-SQL code, an SSRS report, etc.  What can you do to streamline data presentation?  I used a CTE, you can use one, but you don’t have to.  No hard format, just be creative, and mention the importance of data presentation.