Ms VS2017 with SSDT has the 'User with Password' template but thinks it's wrong

dba.stackexchange https://dba.stackexchange.com/questions/236816

  •  30-01-2021
  •  | 
  •  

سؤال

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