0

I configured private and shared session using SQL Provider, following this link After I deployed the Sitecore.Sessions.dacpac file, I tried to create a user for the database but it was failing with the error

USE [MyProject_Sessions]
GO

CREATE USER [sessionsuser] WITH PASSWORD='password@123', DEFAULT_SCHEMA=[dbo]
GO

enter image description here

So I created a login assigned db_datareader and db_datawriter like in other users such as master user but the login did not work. Currently, I'm using 'sa'. If I want to create a separate login for this DB, what all roles are required.

Version: Sitecore 9.2 Initial, Microsoft SQL Server 2017

  • can you share the SQL script you are using to create? – Gopikrishna Gujjula Oct 21 at 3:37
  • @GopikrishnaGujjula I updated the question with the query, please check – Jojo Oct 22 at 5:20
1

From the error it seems that your database server is not configured with Contained Authentication.

Please execute below script on your server

sp_configure 'contained database authentication', 1;
GO
RECONFIGURE;
GO

  • 1
    This I tried already but did not work. I found below in sitecore setup package and was able to create a new user Use [PlaceholderForDB] GO alter database [PlaceholderForDB] set containment = partial GO CREATE USER [PlaceHolderForUser] WITH PASSWORD = 'PlaceHolderForPassword'; GO EXEC sp_addrolemember 'db_datareader', [PlaceHolderForUser]; EXEC sp_addrolemember 'db_datawriter', [PlaceHolderForUser]; GO GRANT EXECUTE TO [PlaceHolderForUser]; GO – Jojo Oct 22 at 10:12
  • Can you please update the question with SQL server version you are using? – Mohit Dharmadhikari Oct 22 at 10:18
  • Updated with sql version – Jojo Oct 22 at 10:28

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.