locked
SQL Database user password change (For specifc database) RRS feed

  • Question

  • How do I change the password of a user in my database?  I have a web server that points to this database with a specific password.  I need to change the password in my SQL database for this user to match that password. 

    Background...  Moved SQL database to new server. 

    I know very little about SQL.

    Tuesday, December 28, 2010 2:35 PM

Answers

  • I am assuming your web application is using mixed mode authentication

    in SQL server User is database level while login is server level.

    Try to do is from management studio GUI

    You need to change password for the server level, keeping in mind, expand security node (server level and not the database level) in SQL Server management studio

    right click on a login and select properties, and change password for a login there.

    Changing password requires ALTER ANY LOGIN and ALTER ANY CREDENTIAL  permission. Starging with SQL server 2008 you may be an administror of your windows machine but that does not mean you are an administror of SQL server (unless you have been granted local windows admins as sql server administrators during the setup)

     

    >>When I copy a database does it change these user passwords to a default password? 

    NO,  

    Tuesday, December 28, 2010 3:28 PM

All replies

  • You need to use ALTER LOGIN

    http://msdn.microsoft.com/en-us/library/ms189828.aspx

    Syntax would be

    ALTER LOGIN <LoginName> WITH PASSWORD = '<enterStrongPasswordHere>';
    
    Tuesday, December 28, 2010 2:39 PM
  • How do I go about doing that?  I see the syntax but what do I do with it?  Thanks!
    Tuesday, December 28, 2010 2:41 PM
  • Do I right click on it - script user as - create to - new query editor window?  Sorry I'm really new at this!  Thanks!
    Tuesday, December 28, 2010 2:45 PM
  • You need to use SQL Server management studio and write above SQL statement in Query Editor

     

    Tuesday, December 28, 2010 2:45 PM
  • Ok I click on Database Engine Query

    I see the blank white area where I type

    ALTER LOGIN <BBUSER> WITH PASSWORD = '<ThisIsMyPassword>

    Does this look right?  should the " ' " be there in front of my password?  I'm getting script errors.

     

    Tuesday, December 28, 2010 2:52 PM
  • Ok I figured out the correct syntax.  Now it says the username does not exist or I don't have permission.  I'm looking right at the username so I know it's there.  I assume that does mean it exists where this is trying to change it...  I'm logged in as administrator.  When I copy a database does it change these user passwords to a default password?  If that's the case I can just change the password on our web script to match the default of the user.  Make any sense?
    Tuesday, December 28, 2010 3:05 PM
  • I am assuming your web application is using mixed mode authentication

    in SQL server User is database level while login is server level.

    Try to do is from management studio GUI

    You need to change password for the server level, keeping in mind, expand security node (server level and not the database level) in SQL Server management studio

    right click on a login and select properties, and change password for a login there.

    Changing password requires ALTER ANY LOGIN and ALTER ANY CREDENTIAL  permission. Starging with SQL server 2008 you may be an administror of your windows machine but that does not mean you are an administror of SQL server (unless you have been granted local windows admins as sql server administrators during the setup)

     

    >>When I copy a database does it change these user passwords to a default password? 

    NO,  

    Tuesday, December 28, 2010 3:28 PM
  • Hi,

    The following article Change SQL Server Login Password in SQL Server explains steps to be followed to Change SQL Server Login Password in SQL Server.

    Hope that Helps!

    Cheers,
    Ashish Kumar Mehta

    Please click the Mark as Answer button if a post solves your problem and Vote as Helpful if a Post is Helpful!

    Thursday, June 14, 2012 8:55 AM