SQL Server command line script from the documentation does not work for AWS RDS instances

XMLWordPrintable

    • Severity 3 - Minor
    • 0

      SQL command line commands from Connecting Bitbucket Server to SQL Server fail with the following error when running on RDS instance:

      Msg 15151, Level 16, State 1, Server EC2AMAZ-FCN8RKS, Line 1
      Cannot find the principal 'bitbucketuser', because it does not exist or you do not have permission.

      Possible workaround:

      CREATE DATABASE atldb
      GO
      USE master
      GO
      CREATE LOGIN atldbuser WITH PASSWORD=N'password', DEFAULT_DATABASE=atldb, CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
      GO
      USE atldb
      GO
      ALTER DATABASE atldb SET ALLOW_SNAPSHOT_ISOLATION ON
      GO
      ALTER DATABASE atldb SET READ_COMMITTED_SNAPSHOT ON
      GO
      ALTER DATABASE atldb COLLATE SQL_Latin1_General_CP1_CS_AS
      GO
      SET NOCOUNT OFF
      GO
      CREATE USER atldbuser FOR LOGIN atldbuser
      GO
      ALTER ROLE db_owner ADD MEMBER atldbuser
      

              Assignee:
              Christine Haiss (Inactive)
              Reporter:
              Andrei Khudavets
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: