Archive | August, 2010

For Your Review: InappropriatePASSSessions

So I was chatting with @SQLChicken the other night, and I made this comment:

Next thing I  knew, @sqlsoldier threw a hash tag on it, and off it went.

It turns out people are thinking a lot of inappropriate thoughts about SQL Server. After pulling the first 24 hours worth of #InappropriatePASSSessions tweets into a table, cleaning  out retweets, replies, and other fodder, we have a solid 535 initial suggestions for perfectly inappropriate (and sometimes far worse), sessions for the SQL PASS Summit 2010.

So Guess What? I Wasn’t Really Kidding About the Contest.

Will there be slide decks? Will YOU be asked to be on the Inappropriate Program Committee?

It just might happen. Maybe. We’ll see. Sign yourself up for the  Summit and let me know in the comments if you’re up for it. If it does happen, there will be fabulous, inappropriate prizes!

For now, the Proposed Inappropriateness Follows, Grouped by Tweep

Vote for your favorites in the comments.

Fine print: The #InappropriateSQLPass hash tag was removed for readability. @SQLChicken also archived these on twapperkeeper. Credits to @peschkaj and Brad Schulz‘s blog posts on string concatenation (linked on names) for helping me remember how to query this stuff out into nice HTML. Those are worth reading, y’all.

Continue Reading →

Comments { 11 }

Dear PASS Board of Directors and NomCom…

Things have been a little wacky lately on the internetz. On Twitter, I read too much about how the #passvotes election has been destroyed by rabid woodchucks, and my blog subscriptions are all het up with controversy.

ELECTIONS. Makes people crazy, I tell you.

I’m not Here to Say Who’s Right or Wrong. I’m Just Saying Y’all Are Awesome.

That’s right. Cause honestly, right now I’m just here for the RDBMS goodness.

Want to know one thing I like about PASS and the SQL Server Community? Y’all just take care of managing all this stuff for me and I get to learn a whole ton and have a great time.

I went to the SQL PASS Summit for the first time last year after hearing about it for several years, and I learned so much my head hurt every day. I was all sorts of excited. I took everything I learned back to work and researched more and solved some really interesting problems. It was worth the investment not only because of the knowledge I got, but because of how it shaped my thinking and my approach. And also for how excited it made me about what I do.

That’s kind of rad!

So As Far as I Can Tell, Here’s How it Breaks Down

Super scientific like:

So, Thanks

That’s my comment, really. Thanks.

The PASS Summit was pretty spanking awesome last year and I think it’s going to be even better this year. Most of the people who enjoy it don’t have the forum to say “Thank You” to you.

And I really like #24HOP. And SQL Saturdays. And I’m thinking the PASS Rally thing next May will prolly be pretty great too.

So this is my little forum, and thanks.

And please don’t let alla these controversies get you down:  most of  us are just looking forward to seeing you all and the ginormous sack full of sessions and fun that’s coming November 8-11th.

Comments { 10 }

Automation: Granting Read Perms for Developers

Yeah, you heard me.

Do you like to read?

“But Kendra, why would we want to grant developers read  permissions? And why would we automate  it? And at what point did you lose your mind?”

Well, Virginia, there may or may not be a Santa Claus, but there are a lot of developers and good reasons to give them read access on many SQL Server instances. In my world, it’s every instance in the pre-production environment, which is a couple  hundred and growing. And it ain’t just read they’re needing, they should be empowered with all of:

  • In master: View server state– so they can look at all those pesky spids they can block, and which may be causing problems they’re investigating.
  • In msdb:
    • db_datareader — so they can query things not easily seen through the GUI
    • SQLAgentReaderRole — so they can look at currently executing jobs and history through the GUI
  • In each user database:
    • db_datareader — for troubleshooting, troublemaking, and general read-i-ness
    • view definition — so they can see what they’re dealing with
    • showplan — so there ain’t no excuse if they’re causing issues, and also to help further with the troubleshooting

And of course a user needs to be created in msdb and the user databases for this all to work out. Things to look out for: SQL Server will let you create a login and apply database level permissions with T-SQL without the user being created, but then you’ll find it doesn’t work.

When you’re dealing with a large pre-production environment and a large group  of developers (> 75 total) who periodically change roles, this permission set can be a bit complicated to manage.

How I Rigged this Up

In my implementation, this script is in a job on an MSX master server, and our server build steps for pre-production servers include configuring  the instance as a TSX subscriber and adding the job. The job is scheduled to run daily, so if new databases are created, restored, or dropped and recreated, permissions will automatically be re-applied. I like using the MSX  job for the implementation because it’s easy for our DBA team to see the job on the instance and see exactly what it does, and if there’s any reason to exempt an instance then that’s very simple to do.

So with this solution, I don’t have to worry about the mechanics of applying read permissions. I just have to worry about making sure the right people are in the active directory group, and I can pass that task on to their managers.

Important: Because of how our active directory and firewalls are configured, I do not have to worry about  this job being accidentally deployed to a production server and granting read where it should not. Something to think  about! Don’t automate yourself into security violations. This was another reason I chose the relatively “transparent” solution of an MSX subscriber job rather  than other solutions.

The Script

Disclaimer: This script was tossed together quickly. If you read the story above, you know I wasn’t even working on it for production. It supports windows groups only  in its current form. (Please don’t use sql authentication to grant read. Domain groups are so much more auditable and controllable!) It grants permissions directly to a login and does not create a role in each database. This is for a good reason in my world, but the best practice is to create a role, so keep that in mind.

As always, test the stuffing out of this and edit as needed if you’d like to make use  of it. Continue Reading →

Comments { 2 }