Yesterday night was almost ruined when I tried to connect my special VB.net project with Microsoft SQL Server 2005 in Vista operating system. Even after spending several hours in examining and understanding the error message I didn’t find any perfect solution for my problem. But today again I put myself to solve the problem and this time I was bit lucky when I discovered that my ‘Sa’ account in SQL server 2005 is in disable mode. A small red color downwards arrow icon can be seen just in the left side of the ‘Sa’ account icon. Later I learned that the so called ‘Sa’ account is by default in disable mode in Microsoft SQL server 2005 standard and express edition. Only after enabling my ‘Sa’ account I was able to connect my dot net project to SQL server database using SQL server login authentication.
Command for Enabling and Disabling SQL server 2005 is – ALTER .For example : –
Enable ‘sa’ account – ALTER LOGIN sa ENABLE
Disable ‘sa’ account – ALTER LOGIN sa DISABLE
Note : Go to Query window -> enter the above Command -> execute the Query.
How to change the name of ‘sa’account ?
If we want to give a extra top security to hackers or miscellaneous person then we have to change the name of the ‘sa’ account because many advance user or SQL database administrators adopts this very method to take security measures.
ALTER LOGIN [sa] WITH NAME = [AdminUser]
Note : Replace AdminUser with you favorite username.