How to create a user for a login in 2013 SQL Server Database Project

后端 未结 2 1201
半阙折子戏
半阙折子戏 2021-02-05 09:59

I\'m trying to create a user with a login for a SSDT database project. The login already exists on the target server. With the following SQL:

CREATE USER [MyLogi         


        
2条回答
  •  感情败类
    2021-02-05 10:30

    You can actually create the Server Level Login within the SQL Server Database Project using the standard T-SQL Syntax:

    CREATE LOGIN [Login_Name] WITH PASSWORD = '';
    

    Note: You can also right-click the database project and choose 'Add New Item' and navigate to SQL Server > Security (within the templates dialog) and select 'Login (SQL Server)'.

    This resolves the SQL71501 Error and (assuming you are using SQLPackage.exe for deployment) will allow SQLPackage.exe the ability to compare the security object with the target Database before deployment and publishing occurs.

    Hope that helps :)

提交回复
热议问题