Monday, March 12, 2012

Getting permission for user "sa" on SQL Server Express 2005

I originally installed SQL Server Express 2005 on my computer using Windows Authentication mode, and discovered when I tried to add another user/login that I didn't have permission to do so. This is rather odd as the windows account that I installed SQL server with is the system admin for the computer.

I have successfully changed the login mode to mixed, and have tried to login in as "sa", but it appears that "sa" was given some sort of password (did SQL server automatically generate one?), and I don't know what it is. When I go into command prompt and try to change the password, it says that it cannot alter the login 'sa' because it does not exist or I do not have permission (i'm pretty sure it's the later, as 'sa' shows up on the list of logins in SQL server express).

I'm so stuck! Please help!Log into the instance, and run the following stored procedure:

sp_helpsrvrolemember

this will tell you what group or login has been added tot he sysadmin group. You may simply need to add yourself to a local windows group to get sysadmin privileges.|||"sa" is the only member of that server role.

where do I see which users are members of what local windows groups?|||nevermind that last bit.
I am a member of the administrators group in the Windows local group...
Should I try logging on as the "administrator" user and seeing if I can make the changes there?|||How was this instance installed? Usually BUiLTIN\ADMINISTRATORS is a sysadmin. There is also an option to specify an sa password on installation.|||I'm not really sure how I figured this out, but I went in and added myself to every Windows local group that had something to do with SQL and now I am able to do administrative stuff in my database.
*phew*|||I think my system came with SQL server express 2005 already installed on it.

I did go in enable the Administrator's account in the Windows Users accounts, in addition to adding myself to a bunch of groups, and now when I run the query previously mentioned, BUILTIN\ADMINISTRATORS is listed as a sysadmin - which must be what is giving me, one of the administrators, sysadmin privileges.

No comments:

Post a Comment