You must Sign In to post a response.
  • Category: SQL Server

    How to set a password for a database


    Are you looking for a way to set a password for database ? then read this thread to know how to set it



    I want to set a password for my database in sqlserver,am using sqlserver2012. how can i set up password??
  • #725971
    You need to set password for SystemAdmin (SA) uesr right ? then follow the steps
    Login into SQL server using Windows Authentication. (you can use windows uesrname and password)
    2. In Object Explorer, open Security folder, open Logins folder. Right Click on sa account and go to Properties.
    3. Type a new SQL LOGIN password, and confirm it. Click OK to finish.

    you can do it by using Query also.
    From A query Window you can try this
    - Open SQL Server Management Studio, login with windows authentication
    - Open a new query
    - Type the follow commands and excute:

    GO
    ALTER LOGIN [LOGIN_NAME] WITH DEFAULT_DATABASE=[master]
    GO
    USE [master]
    GO
    ALTER LOGIN [LOGIN_NAME] WITH PASSWORD=N'New_Password' MUST_CHANGE
    GO

    Thanks
    Koolprasd2003
    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #725984
    You can set password of database through write Transact-SQL command in Query Editor, To do this like the following :

    CREATE LOGIN <login name> WITH PASSWORD = '<password>' ; GO

    Create Windows Authentication for user by using Transact-SQL in Query Editor, like following :

    CREATE LOGIN <name of Windows User> FROM WINDOWS; GO

  • #730267
    CREATE LOGIN test
    WITH PASSWORD = 'xyz$';
    GO



    hope this will help

    sriram


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.