When running Ola's full SQL Server Maintenance Solution or the individual databasebackup script I get the following error:
MSG 207, Level 16, State 1, Procedure DatabaseBackup, Line 1545
Invalid column name 'schemaName'.
This is part of the @databasesInParallel
section which it appears to be trying to run even though this variable is set to 'N'
at the beginning of the script. I haven't altered anything and this script works perfectly on other servers.
Best Answer
The
dbo.Queue
table exists, but does not have theSchemaName
column. This can be due to a custom dbo.Queue table that has nothing to do with Ola's solution. You could rename the table in the maintenance plan or drop the existing tables.Recreating the error
Step 1: Recreate the maintenance solution Procedure
Step 2 Create the
dbo.Queue
table without theSchemaName
Step 3: Create the
dbo.QueueDatabase
tableStep 4: Try to take a backup
Error:
Why
The query fails because the table exists but the
schemaname
column does not. If table does not exist, it succeeds.Testing the part that causes the error & resolving it
Error message
Dropping the two previously created tables
and rerunning the statement produces no error: