Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Log on to your computer as the Local Administrator account. By default, that should be a sysadmin role in MSSQL.</p> <p>Using SSMS, connect to your MSSQL instance using integrated authentication. You are now a sysadmin. As a sysadmin, you can now <a href="http://msdn.microsoft.com/en-us/library/ms186320.aspx" rel="nofollow noreferrer">add your normal user account to the sysadmin role</a>:</p> <pre><code>EXEC sp_addsrvrolemember @loginame = 'PC_OR_DOMAIN\loginname', @rolename = 'sysadmin' </code></pre> <p>If you use SSPI (aka Integrated Authentication, aka not a different username and password when you start up SSMS) then just use your Windows login as the loginame. If you use Sql Server Authentication (aka, a username and password) then use the username as loginame. If you use any other loginame, an account will be created as well.</p> <p>There's certainly a way to do it within the GUI - but I don't have it handy ATM to tell you how. I think it's under Security -> Logins -> Properties and some checkboxes for the various server roles.</p> <p>Edit: <a href="http://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/" rel="nofollow noreferrer">Enabling the local admin account on Vista</a> Also, if you <em>are</em> a local Administrator (your user account is listed under Local Administrators group) then - <em><a href="http://support.microsoft.com/kb/263712" rel="nofollow noreferrer">by default</a></em> - you are a sysadmin. It may be worth double checking the members of the sysadmin role (SQL) and the Local Admins group (Vista).</p> <p>Edit2: Turns out, SQL 2008 <a href="http://msdn.microsoft.com/en-us/library/cc281849.aspx" rel="nofollow noreferrer">does <em>not</em> add BUILTIN\Administators</a> any more. In that case, you need to check what you <em>did</em> add. That should be available via the Logins node. There is a note that you can be <a href="http://msdn.microsoft.com/en-us/library/cc280562.aspx" rel="nofollow noreferrer">locked out</a> of MSSQL Admin if you don't choose a sysadmin login. If that's the case, I'd reinstall. You can save your databases by stopping MSSQL and copying the *.MDF and *.LDF files. After reinstallation, copy them back and use sp_attach_db to reattach them. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload