I need to make a sql login also be a db user with the same name

  • I need to make a sql login name also become a database user with the same name.

    How do I make the login name also become a database user with the same name AND be mapped correctly to each other.

    Thanks in advance

  • rpk7309 (6/16/2015)


    I need to make a sql login name also become a database user with the same name.

    How do I make the login name also become a database user with the same name AND be mapped correctly to each other.

    Thanks in advance

    You need to create a database user for the login:

    use [dbname];

    create user [username] for login [loginname] with default_schema = dbo;

    --now grant whatever database permissions are appropriate to [username]

  • Create LOGIN [ClarkKent] WITH PASSWORD='NotTheRealPassword'

    USE [WHATEVER]

    Create USER [ClarkKent] FOR LOGIN [ClarkKent]

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply