Last week Linchi Shea wrote a posted a blog entry entitled “How does that AD user account get access to the database?“. In it Linchi shows a method of finding out the domain groups that a SQL Server user uses to access the database.
There is however an easier, method you can use.
There is a system extended stored procedure called xp_logininfo. Microsoft was even kind enough to document the procedure for us. You can use this procedure to see what group a use belongs to, or what users are in a domain group, all from T/SQL.
For example, on my sandbox instance if I run
EXEC xp_logininfo 'CORP\dcherry'
I get a result set which says that I gained my access to the SQL Server via the “BUILTIN\Administrators” group.
This is a nice quick and easy method to see what domain group a user used to access the SQL Server.
I didn’t know this was such a well guarded secret. Which leads me to a story to share. I had a supervisor (Ed) back at EarthLink who made it a point to have story time during his pre-shift meetings, those were the best days to be working. I remember that Ed was on vacation once and our assistant supervisor Dennis was running the team. Well instead of telling us a story, he brought in a kids picture book to read to us. It was awesome, there were about 80-90 tech support reps all sitting in the break room hanging on every word from a book for 2 year olds. Funniest sight ever.
But that’s a whole different story than the one I wanted to share.
One one particularly long night at EarthLink, back in 2001 or so (I was using SQL 2000 at the time), I had a lot of database data changes to make (I have no idea why at this point). Probably business rules had changes so data needed to be changed, and indexes needed to be changed, or something. Needless to say SQL was going to be running queries all night long.
Well, having already worked 12-16 hours that day, I didn’t really want to stay up all night watching SQL run. So I cranked up the speakers on the PC as load as they would go (I had some nice speakers so they got loud), and set Windows to as load as it would go (I’m a heavy sleeper) and started the first of the T/SQL Scripts. I promptly curled up on the floor with my pillow and blanket that I had brought in and went to sleep. About three hours later I was woken up by the loudest “Windows ping” ever. It really scared the crap out of me, but it did the job. I checked what ever it was that needed checked and started the next script.
This happened probably three or four times through out the night. The next morning I took a shower (we had showers on site for just such nights), and changed my clothes (my wife was kind enough to bring me a change of clothes before she went to bed) and went on with my new work day, after technically pulling an all nighter that I slept through about 99% of.
If only all, all nighters were that easy.
This used to be a very easy question to answer as the answer was 1. However these days, with some creativity you can get some extra ones.
So, as you may have heard the SQL PASS 2009 Call for Speakers has gone out. I’ve submitted a couple of sessions already, but I was hoping to get some feedback from the community at large about what you think I should submit topics on.
I’ve submitted a couple of SQL Service Broker sessions, as well as a session on Storage, and a session on planning a database migration. I’ve got all sorts of stuff that I could submit, but if no one is interested in it, then there isn’t much point on trying to present those topics.
So I pose this question to you: If you were going to the PASS Summit this year in Seattle what would you like to see presentations on? Should I leave these sessions up there, or replace them with others?
The slide decks and sample code that Brent and I presented with have been uploaded. The recordings have to be edited down, as Live Meeting uses a single large recording, and no one wants to sit through a 5 hour recording, so it’s being broken down into smaller chunks.
The slide decks are hosted via Slide Share and the sample code from my presentation is up on the SQLServerPedia.com servers.
For anyone that will be attending this weeks LA SQL User Group Meeting over at UCLA, here is the slide deck that I’ll be presenting from. Feel free to check it out in advance. If you aren’t attending and have questions feel free to post them here and I’ll get them answered for you as quickly as I can.
See you there.
All to often when helping people look at query performance problems I’ll ask them to look at the execution plan, and see what it says. Most query performance problems can be resolved simply by looking at the execution plan and seeing where you need to add an index.
All to often I (and others) then get asked, how to I look at the execution plan, and what does it mean?
I ran across the post A Culture of (Potential) Assholes: Sexual Harassment in IT on twitter today, and all I could think was “What the hell is wrong with people?”
Before I go on, I’d like to go on the record with a few things. I’m a guy, and have on occasion been called a pig (I try and keep these occasions as few and far between as I can). So I’m not above treating people like crap, but this is just so far beyond acceptable.
They story which is given on the thread is that a drunk “douche bag” (my words not his) walked up to a woman (which I assume he didn’t know) and gave her his room key telling her that she better he up to his room later.
I just can’t imagine doing this to someone. Now maybe I’m a more evolved form of caveman, I don’t know. Now, the original poster didn’t say which conference this was in his post, but I will because I think that it makes it even more pathetic that the creep said what he said to this woman. This was the MVP Summit in Seattle. For those that don’t know what the MVP Summit is, this is when Microsoft invites all the members of the MVP program for that year up to Seattle and show them all the shinny new things that they are working on.
Now I know that this is the first year that I’ve been an MVP, so some may think that I’m talking out of turn here, but too bad. I’m pretty sure that someone being an ass at the hotel isn’t covered by the NDA.
Why do I mention that this is the MVP Summit? Because we were all invited by Microsoft to come meet our peers in the program, and the product groups. One of the many things that you have to agree to when you become an MVP is a code of conduct. While this code of conduct is pretty basic, and hard to enforce in the real world, when you are at the Microsoft Summit, its pretty easy for Microsoft to enforce it. Rule #1 on the code of conduct is “No disrespectful behavior”. There’s a breakdown which I won’t bother to go into, since that is pretty self explanatory. (Don’t get me wrong I don’t think this sort of poor behavior would fly at any other event or time either.)
Everyone at the Summit is an MVP or a Microsoft Employee, so one would assume that the level of peer respect would be high. Don’t get me wrong, there is a health banter between MVPs of different products. The members of my product group (SQL Server) like to pick on the FoxPro and Access but we certainly have a respect for the MVPs of those products.
Becoming an MVP is hard work, no matter the product you represent. Some of the MVPs catch a lot of crap for the products that the represent (XBox, Zune and Office probably catch the most crap from people). Everyone who is an MVP got there for the same reason, they support their respective community and user base. Without knowing any of the Zune MVPs (as an example) I know that they got to be a Zune MVP by providing steller support to the Zune user base.
I think that its just horrible to speak like this to anyone, especially someone you should be considering a peer.
I think, I’ve gotten off point, and I’m starting to ramble so I’ll wrap up with this. The person who gave her his room key should be ashamed of himself. And the guy who was sitting next to her who tried to make a funny comment and ended up WAY over the line should also be ashamed of himself.
I’ll leave you with this though. If you can’t be bothered to respect people in public, then don’t show up. If you insist on showing up, then consider this before you make an ass out of your self; someone who saw you may be a customer of yours, or a future customer of yous, or a future boss of yours. Wouldn’t that suck to loose a big sale, or your that promotion because of some dumb ass thing you did when you were drunk on a company trip. And no being drunk isn’t an excuse. If you act like that when you are drunk, then you shouldn’t be drunk in public.
A while back I was looking at a clients database and we were looking at why the ASPState database was having blocking issues. So I through this script together to show not only the blocked processes, but also the blocking processes, but also include the name of the stored procedure as well as the statement within the stored procedure which was causing the blocking. Continued »
Last week I published a new article on Enterprise IT Planet called “Developing a SQL Server Database Backup Plan” in which I go over some of the techniques which are used to backup databases and why you need to ensure that your databases are backed up.