How do I create a new user in a SQL Azure database?

后端 未结 9 1697
礼貌的吻别
礼貌的吻别 2020-12-12 13:17

I am trying to use the following template:

-- =================================================
-- Create User as DBO template for SQL Azure Database
-- ====         


        
9条回答
  •  轮回少年
    2020-12-12 13:44

    Check out this link for all of the information : https://azure.microsoft.com/en-us/blog/adding-users-to-your-sql-azure-database/

    First you need to create a login for SQL Azure, its syntax is as follows:

    CREATE LOGIN username WITH password='password';
    

    This command needs to run in master db. Only afterwards can you run commands to create a user in the database. The way SQL Azure or SQL Server works is that there is a login created first at the server level and then it is mapped to a user in every database.

    HTH

提交回复
热议问题