In my database project when I choose the 'User with Password' template in the Add New Item dialog, code is generated, kind of

CREATE USER [u2]
    WITH PASSWORD = 'jbniq_ushfbwc=l5nAxu8aapmsFT7_&#$!~<Jt}ho_aypip@'

GO

GRANT CONNECT TO [u2]

And it's immediately marked as having syntax error:

SQL46010: Incorrect syntax near 'jbniq_ushfbwc=l5nAxu8aapmsFT7_&#$!~<Jt}ho_aypip@'. 

VS 2017 Comminity with SSDT 15.1.61903 Shoud I change some project settings or what?

有帮助吗?

解决方案

As Aaron mentioned in the comments, try enabling containment in the database settings:

screenshot of ssdt settings

That's after right-clicking the database project and choosing "properties" in Visual Studio.

If you are not using contained databases, use the "User" script template instead of the "User with Password" script template.

许可以下: CC-BY-SA归因
不隶属于 dba.stackexchange
scroll top