<small id='8bVj0'></small><noframes id='8bVj0'>

  1. <i id='8bVj0'><tr id='8bVj0'><dt id='8bVj0'><q id='8bVj0'><span id='8bVj0'><b id='8bVj0'><form id='8bVj0'><ins id='8bVj0'></ins><ul id='8bVj0'></ul><sub id='8bVj0'></sub></form><legend id='8bVj0'></legend><bdo id='8bVj0'><pre id='8bVj0'><center id='8bVj0'></center></pre></bdo></b><th id='8bVj0'></th></span></q></dt></tr></i><div id='8bVj0'><tfoot id='8bVj0'></tfoot><dl id='8bVj0'><fieldset id='8bVj0'></fieldset></dl></div>

    <legend id='8bVj0'><style id='8bVj0'><dir id='8bVj0'><q id='8bVj0'></q></dir></style></legend><tfoot id='8bVj0'></tfoot>

      • <bdo id='8bVj0'></bdo><ul id='8bVj0'></ul>
    1. 如何在 SQL Azure 数据库中创建新用户?

      时间:2023-09-17

      • <legend id='AyX0m'><style id='AyX0m'><dir id='AyX0m'><q id='AyX0m'></q></dir></style></legend>

      • <tfoot id='AyX0m'></tfoot>

        <small id='AyX0m'></small><noframes id='AyX0m'>

            <tbody id='AyX0m'></tbody>
          • <bdo id='AyX0m'></bdo><ul id='AyX0m'></ul>
              <i id='AyX0m'><tr id='AyX0m'><dt id='AyX0m'><q id='AyX0m'><span id='AyX0m'><b id='AyX0m'><form id='AyX0m'><ins id='AyX0m'></ins><ul id='AyX0m'></ul><sub id='AyX0m'></sub></form><legend id='AyX0m'></legend><bdo id='AyX0m'><pre id='AyX0m'><center id='AyX0m'></center></pre></bdo></b><th id='AyX0m'></th></span></q></dt></tr></i><div id='AyX0m'><tfoot id='AyX0m'></tfoot><dl id='AyX0m'><fieldset id='AyX0m'></fieldset></dl></div>

                本文介绍了如何在 SQL Azure 数据库中创建新用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在尝试使用以下模板:

                I am trying to use the following template:

                -- =================================================
                -- Create User as DBO template for SQL Azure Database
                -- =================================================
                -- For login <login_name, sysname, login_name>, create a user in the database
                CREATE USER <user_name, sysname, user_name>
                    FOR LOGIN <login_name, sysname, login_name>
                    WITH DEFAULT_SCHEMA = <default_schema, sysname, dbo>
                GO
                
                -- Add user to the database owner role
                EXEC sp_addrolemember N'db_owner', N'<user_name, sysname, user_name>'
                GO
                

                我想创建一个名为 user1 的用户,密码为user1pass".我连接了我的默认数据库身份验证",并打开了一个查询窗口.

                I would like to create a user called user1 with a password of 'user1pass'. I connected with my default database 'authentication' and I have a query window open.

                但是模板对我来说没有意义.例如,sysname 是什么,我在哪里提供密码以及我应该使用什么作为 default_schema?

                But the template does not make sense for me. For example what's sysname, where do I supply the password and what should I use as the default_schema?

                特定用户需要拥有做所有事情的权力.但是我如何设置它以便他可以做任何事情,如果我让用户成为数据库所有者就完成了吗?

                The particular user needs to have the power to do everything. But how do I set it up so he can do everything, is that done if I make the user a database owner?

                到目前为止我已经尝试过:

                So far I have tried:

                CREATE USER user1, sysname, user1
                    FOR LOGIN user1, sysname, user1
                    WITH DEFAULT_SCHEMA = dbo, sysname, dbo
                GO
                

                给予:

                消息 102,级别 15,状态 1,第 1 行 ',' 附近的语法不正确.

                Msg 102, Level 15, State 1, Line 1 Incorrect syntax near ','.

                和:

                CREATE USER user1
                    FOR LOGIN user1
                    WITH DEFAULT_SCHEMA = dbo
                GO
                

                给予:

                消息 15007,级别 16,状态 1,第 1 行 'user1' i

                Msg 15007, Level 16, State 1, Line 1 'user1' i

                不是有效登录名或您没有权限.

                s not a valid login or you do not have permission.

                推荐答案

                查看此链接以获取所有信息:https://azure.microsoft.com/en-us/blog/adding-users-to-your-sql-azure-database/

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

                首先需要为SQL Azure创建一个登录名,其语法如下:

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

                CREATE LOGIN username WITH password='password';
                

                此命令需要在 master db 中运行.只有在此之后,您才能运行命令在数据库中创建用户.SQL Azure 或 SQL Server 的工作方式是首先在服务器级别创建一个登录名,然后将其映射到每个数据库中的用户.

                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

                这篇关于如何在 SQL Azure 数据库中创建新用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:使用 BETWEEN 条件对 INNER JOIN 进行性能调整 下一篇:如何查看在 Azure SQL 服务器实例中授予任何数据库用户的角色和权限?

                相关文章

                1. <legend id='vqtJC'><style id='vqtJC'><dir id='vqtJC'><q id='vqtJC'></q></dir></style></legend>
                  • <bdo id='vqtJC'></bdo><ul id='vqtJC'></ul>

                  <small id='vqtJC'></small><noframes id='vqtJC'>

                  <i id='vqtJC'><tr id='vqtJC'><dt id='vqtJC'><q id='vqtJC'><span id='vqtJC'><b id='vqtJC'><form id='vqtJC'><ins id='vqtJC'></ins><ul id='vqtJC'></ul><sub id='vqtJC'></sub></form><legend id='vqtJC'></legend><bdo id='vqtJC'><pre id='vqtJC'><center id='vqtJC'></center></pre></bdo></b><th id='vqtJC'></th></span></q></dt></tr></i><div id='vqtJC'><tfoot id='vqtJC'></tfoot><dl id='vqtJC'><fieldset id='vqtJC'></fieldset></dl></div>

                  <tfoot id='vqtJC'></tfoot>