Forum / Remote Desktop Manager - Beta

SQL Schema Error x64

  • Create an Issue
  • Cancel

Invalid column name 'PrimaryToDoUsersId'

System.Data.SqlClient.SqlException (0x80131904): Invalid column name 'PrimaryTodoUsersID'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseConnectionDataSource.ExecuteNonQuery(String sql, IDbTransaction dbTransaction, IDbDataParameter[] parameters, Int32 commandTimeout)
at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseTodoSubDataSource.DeleteTodos(Connection connection, IDbTransaction transaction)
at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseConnectionDataSource.DeleteConnection(Connection connection)
Error Number:207,State:1,Class:16

I backtracked through the code and suspect the trigger for "create trigger dbo.tr_ToDoUsers on dbo.ToDoUsers is suspect. I see it referrering to the inserted column join on PrimaryToDoUsersId in dbo.ToDo. Dbo.ToDo does not have a column called PrimaryToDoUsersId. I think this was intended to be Id.

Regarding design of this, I'll suggest you consider modifying this behavior if possible as I see triggers used to do a lot of these deletes, and my general recommendation would be to instead look at establishing foreign key with cascade deletes instead of using triggers to cleanup. You can then create stored procedures that call the delete action in correct order and avoid even needing the cascade delete for larger databases. Triggers are a real antipattern in many cases that can cause scalability issues at times. I normally avoid them unless setting up some various server administration type events. That's my 10 cents, feel free to ping me with more if you want. My focus is SQL Server performance, so when I dug in and saw a lot of triggers for the maintenance, I thought perhaps you could design it more based on stored procs and FK. Not sure if this is feasible due to your cross platform schema design of course.

Clock2 yrs

Example. Modifying this still didn't fix my root issue, so it might be other things are either broken in my db, or this update had some schema mapping issues with this that needs to be fixed. probably just going to reinstall db as I use scripts to setup most of it anyway.

Clock2 yrs


Can you please send us your schema for File > Data Sources > Upgrade (tab) > Email schema to support?

Please add: Attn:stefane

I will analyze your schema and get back to you.

Best regards,

Stefane Lavergne


Clock2 yrs

I had purged and rebuilt my repo, so please disregard this if you aren't getting others with the same error. I rebuilt my RDM instance and am working fine right now.

Clock2 yrs

i have this issue in this version: 2019.1.21.0
Can you please help me?

Clock7 mths

@Peter Cermak,

Could you try RDM 2019.1.36.0? You can download this version here

Best regards,

Jeff Dagenais

Clock7 mths