liquibase.exception.DatabaseException

liquibase.exception.DatabaseException: Incorrect syntax near the keyword 'null'. [Failed SQL: IF USER_NAME() <> N'dbo' BEGIN DECLARE @sql [nvarchar](MAX) SELECT @sql = N'ALTER USER ' + QUOTENAME(USER_NAME()) + N' WITH DEFAULT_SCHEMA = null' EXEC sp_executesql @sql END]

Solutions on the web363

  • via JIRA by Gary Plante, 1 year ago
    liquibase.exception.DatabaseException: Incorrect syntax near the keyword 'null'. [Failed SQL: IF USER_NAME() <> N'dbo' BEGIN DECLARE @sql [nvarchar](MAX) SELECT @sql = N'ALTER USER ' + QUOTENAME(USER_NAME()) + N' WITH DEFAULT_SCHEMA = null' EXEC sp_executesql @sql END]
  • via JIRA by Gary Plante, 1 year ago
    liquibase.exception.DatabaseException: Incorrect syntax near the keyword 'null'. [Failed SQL: IF USER_NAME() <> N'dbo' BEGIN DECLARE @sql [nvarchar](MAX) SELECT @sql = N'ALTER USER ' + QUOTENAME(USER_NAME()) + N' WITH DEFAULT_SCHEMA = null' EXEC sp_executesql @sql END]
  • via JIRA by Gregory Bruce, 1 year ago
    liquibase.exception.DatabaseException: Incorrect syntax near the keyword 'null'. [Failed SQL: ALTER USER null WITH DEFAULT_SCHEMA = [dbo ]]
  • Stack trace

    • liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: Incorrect syntax near the keyword 'null'. [Failed SQL: IF USER_NAME() <> N'dbo' BEGIN DECLARE @sql [nvarchar](MAX) SELECT @sql = N'ALTER USER ' + QUOTENAME(USER_NAME()) + N' WITH DEFAULT_SCHEMA = null' EXEC sp_executesql @sql END] at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:157) at liquibase.integration.commandline.Main.doMigration(Main.java:915) at liquibase.integration.commandline.Main.run(Main.java:180) at liquibase.integration.commandline.Main.main(Main.java:99) Caused by: liquibase.exception.DatabaseException: Incorrect syntax near the keyword 'null'. [Failed SQL: IF USER_NAME() <> N'dbo' BEGIN DECLARE @sql [nvarchar](MAX) SELECT @sql = N'ALTER USER ' + QUOTENAME(USER_NAME()) + N' WITH DEFAULT_SCHEMA = null' EXEC sp_executesql @sql END] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:301) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:107) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:97) at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:130) ... 3 more Caused by: java.sql.SQLException: Incorrect syntax near the keyword 'null'. at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372) at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988) at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421) at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:677) at net.sourceforge.jtds.jdbc.JtdsStatement.processResults(JtdsStatement.java:613) at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQL(JtdsStatement.java:572) at net.sourceforge.jtds.jdbc.JtdsStatement.executeImpl(JtdsStatement.java:809) at net.sourceforge.jtds.jdbc.JtdsStatement.execute(JtdsStatement.java:1282) at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:299) ... 7 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    3 times, 3 months ago
    8 times, 11 months ago
    Unknown user
    Once, 1 year ago
    72 times, 1 month ago
    Unknown user
    Once, 2 months ago
    22 more bugmates