Granting Admin rights to SQL Express (When you don’t have sysadmin rights)
I ran into an issue where I’ve been trying to get my local SQL Express instance setup so I would be able to do a bit of local development.
What stopped me is that for some reason, my local account did not have sysadmin rights and in SQLExpress, the sa account is disabled… I guess I did the original install under a different account and when I cleaned up some of the profiles, I nuked it…
After messing around way too long trying to figure it out, MSDN to the rescue: http://archive.msdn.microsoft.com/addselftosqlsysadmin/ (*Update 11/30/2014 - code site retired by MSFT - CMD script can now be found here: https://gist.github.com/hugodahl/8b34cbacf7bcd491b116 )
As long as you have admin rights on your machine, you can run this and give your current account full access to the SQL instance you choose, from there, I was able to get back on track…