1

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?

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.