Tuesday, October 22, 2013

How To Add Yourself To SQL

The other day, I locked myself out of my SQL Server by joining the VM to a domain. When I joined the domain, only the local users had access, because I hadn’t added the domain admins to the machine as sysadmin role members yet, since the machine wasn’t yet part of the domain.

It's a circle!

Anyway, I found myself unable to login to my SQL 2012 instance using Windows Authentication. While adding myself back, I discovered that sp_addsrvrolemember has been deprecated.
net stop <<servicename>>
net start MSSQLSERVER /m
sqlcmd –E –S.
Then, in SQL Server 2008 R2 and earlier, I would do this:

create login [DOMAIN\LOGIN] from windows;
exec sp_addsrvrolemember [ @loginame= ] 'domain\login' , [ @rolename = ] 'role';
But now, in SQL 2012, to be future proof, I have to upgrade my script to look like this:
create login [DOMAIN\LOGIN] from windows;
alter server role 'role' add member='domain\login';
One MS reference:
sp_addsrvrolemember (Transact-SQL)

Tuesday, October 15, 2013

Changing A SQL Server Name

Changing the name of my SQL Server has been anything BUT pretty, easy, or straightforward. I want to collect the various pieces of the process here, so I can remember them when I need them again.

To change the name in the O/S:

** If joining a domain, do it all at once, if at ALL possible **

To then change the name of the already installed SQL Instance:

select @@servername -- was 
sp_helpserver -- was 
select serverproperty('servername') -- was 
select * from sys.servers; -- was 

sp_dropserver '';
sp_addserver '', local;

select @@servername -- is now 
sp_helpserver -- is now 
select serverproperty('servername') -- was already 
select * from sys.servers; -- is now 

Tuesday, October 8, 2013

In another time, and another place . . .

Being an engineer really is like being an artisan class. 

If we were in ancient Greece, though, would that make us landowners?

Since we're not, are there any lessons we can learn from Sparta? Two things spring to mind, from recent life lessons:

1. Focus
The classes were separated by function. Say what you will about classes, there still would have been great shoemakers, good shoemakers, and just-ok shoemakers within the trade class. The goal, I think, of every engineer, is to be the best within their class or specialty. Which brings me to . . .

2. Specialize
The idea of being both a shoemaker and a then a sandal repair specialist might seem silly to us (I mean, really. Beach sandals are like a $1) but if you needed your sandals repaired TODAY so you could march to war tomorrow, would you go to the just-ok maker, for the just-ok price? Or would you pay the higher price for the greater speed and quality of the specialist across town?

I have, and continue, to drive across town for quality. Do you?

Tuesday, October 1, 2013

Interviewee Questions To Ask

Other than a note on “when do I get paid?” there is nothing HR-ish in the following document about pay, salary, pay ranges, or even expected compensation, bonus plan, etc. etc. etc.

I’m not worried about that when hiring for a DBA, SQL Developer, SSIS Developer, etc. role.

Instead, if I’m hiring in to a place filled with poisonous man eating sociopaths, I want to know it up front so I can avoid it all together. I’ve already worked at one of those, and my therapist says I’m making remarkable progress, ha ha ho ho.

Instead, this list is designed to provide the job seeking candidate a fighting chance to not forget the really important things BEFORE they make the jump to a new customer, client, or employer.

I originally designed this as a tool for my own passive job hunt years ago, and have kept it up to date over time. This list is specific to the questions I ask about an environment going in.

Specifically, I want to ask about a few main areas:
  • Hours & Working Conditions
    • Hours
    • Documentation & CCB/CR
    • Client(s) & Customer Service
  • Position & Corporate
    • Positional
    • Corporate
    • Equipment
  • SQL
    • SQL Server Itself
    • DB’s
  • Hardware
    • Location, Location, Location
    • Physical & Virtual
    • Storage
    • Outage & Troubleshooting
    • Getting Work Done

I also watch the interviewers response when I still have twenty questions left – I’ll tell them I do, and watch their reaction. If they aren’t prepared to answer my questions during my one chance to meet and talk with them before we do business, that can also be rather instructive.

Oh, and kids? Turn off your cell phone.

Download the Interview Questions