I installed SQL Server 2008 Enterprise Edition on Windows 7 Ultimate from sadegh user.
This account exists in administrators role. after a few days I removed sadegh user from Windows and now I am using administrator user. But I can’t login to SQL Server database engine using Windows authentication method and I receive this error message:
TITLE: Connect to Server
Cannot connect to SADEGH-PC.
ADDITIONAL INFORMATION:
Login failed for user
‘Sadegh-PC\Administrator’. (Microsoft
SQL Server, Error: 18456)For help, click:
http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
please help me! thanks
Depending on what mode SQL Server was installed (Windows Authentication or Mixed Mode), you may have to do a few things. If you installed in mixed mode, you can log in as sa and add the administrator user as a Login under the Security section. Make sure you assign sysadmin role to the user, which can be found under Server Roles.
If Windows Authentication mode was chosen during install then there are a couple of things you can do, but I think the easiest is just to recreate the user sadegh, login into SQL Server as that user, and follow the previous step to add the administrator user as a login.
UPDATE: If all else fails, you can run SQL Server in Single User Mode, which allows a single connection to the server, and enable/change the sa password. To do this you can:
EDIT:
As indicated by @jimasp in the comments, for step 6 you may have to do ALTER LOGIN sa WITH PASSWORD = ” UNLOCK;, because the sa account may be locked from too many login attempts.
Tested on Windows 7 Ultimate with SQL Server 2008 Standard. Hope this helps.