Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have installed SQL Server 2008 R2, and was able to login and also create a database and everything.

When I was facing some problems with connecting my .NET project with SQL Server, I created some new accounts in SQL Server.

For some reason I uninstalled it. But later when I re-installed, I was not able to login with the "SA" account. I still see a few of the other user accounts that I created earlier.

Is there any way to completely uninstall SQL Server 2008 R2 and successfully install new copy and login?

share|improve this question
    
Reference that I hope that it will help you. support.microsoft.com/kb/322336 –  Jack Sep 10 '12 at 6:00
add comment

migrated from stackoverflow.com Sep 9 '12 at 12:52

This question came from our site for professional and enthusiast programmers.

2 Answers

First of all, one advice: better not use SA login name. Best practice is to disable the SA account. Many of your daily and routinely tasks on the sql server does not requier a high privileged account with sysadmin permissions. Create an account with the appropiate permissions and use it for daily work. Another advice on why to disable the sa account is because every attempt will try to probe the SA account.

--Query to disable the SA account.
ALTER LOGIN sa DISABLE;

Check this post for even more details on the subject.

In case you forgot the password, here and here you have a couple of helpfull posts by Pinal Dave on how to restore.

If you removed all the databases files from all related folders then you should not have any database remaining from previous install. But I do not see the need of removing previous databases.

You can change the server authentication mode by usign this code:

ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = 'your_password_here';
GO

More inforamtion here

share|improve this answer
add comment

Log in with your Windows account and enable the SA login again. You'll probably need to configure the SQL Server for mixed mode authentication as well.

If you decide that you do want to reinstall SQL, after uninstalling it you'll need to remove the database files then you can reinstall. SQL leaves the databases alone when you uninstall so that you don't loose any accounts or data when reinstalling.

share|improve this answer
    
@mrdenny.. Could you please let me know, how to remove database files also, when uninstalling SQL SERVER..To my knowledge... after uninstalling sql server, I have deleted all the related folders to Microsoft Sql server in Program files of C:\ drive correspondingly...Anything more to be done...Or how can I ensure that I have deleted all the database files to remove all the accounts or data.... –  Sreekanth Sree Sep 10 '12 at 5:18
    
The database files could be anywhere. Their location will depend on where you specified during the installation. By default this will be c:\program files\microsoft sql server\mssql.mssqlserver\mssql\data but could be just about anywhere. Search the computer for master.mdf. The files in that folder will be the ones you want to remove. I'd just move them to another folder instead of deleting them. –  mrdenny Sep 11 '12 at 3:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.