Permissions Error with MSSQL

Hi All,

I’m seeing the following error when trying to create a table in a specific (existing) schema.

[2021-11-17 02:49:28] SEVERE [liquibase.integration] The specified schema name “config” either does not exist or you do not have permission to use it.
[Failed SQL: (2760)
CREATE TABLE config.ADFConfig (ADFConfigID int IDENTITY (1, 1) NOT NULL, ConfigName varchar(500) NOT NULL, ConfigActive char(1) NOT NULL, ConfigGrouping varchar(100) NOT NULL, CONSTRAINT PK_ADFConfig PRIMARY KEY (ADFConfigID))]
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Migration failed for change set fred.xml::1637055405311-1::gdh (generated):
Reason: liquibase.exception.DatabaseException: The specified schema name “config” either does not exist or you do not have permission to use it.
[Failed SQL: (2760) CREATE TABLE config.ADFConfig (ADFConfigID int IDENTITY (1, 1) NOT NULL, ConfigName varchar(500) NOT NULL, ConfigActive char(1) NOT NULL, ConfigGrouping varchar(100) NOT NULL, CONSTRAINT PK_ADFConfig PRIMARY KEY (ADFConfigID))]
at liquibase.command.CommandScope.execute(CommandScope.java:156)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:45)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:15)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:325)
at liquibase.Scope.child(Scope.java:186)
at liquibase.Scope.child(Scope.java:162)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:291)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:80)

Running the SQL command hilighted above from within either MSSMS or from sqlcmd in both cases as ‘sa’ succeeds without issue:

Running: SELECT * from sys.schemas:

image

All schemas are owned by dbo

Hi @gregory.harris,

Can you confirm if you are connecting from Liquibase as ‘sa’?

Out of curiosity, is it only accepted as a ‘sa’ user?