Hi,
When adding a new template or a new session I get this error:
[5/9/2012 12:13 PM]ERROR SILENT System.Data.SqlClient.SqlException: Cannot insert the value NULL into column 'DataSourceID', table 'devolution.dbo.ConnectionLog'; column does not allow nulls. INSERT fails.
The statement has been terminated.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Devolutions.RemoteDesktopManager.Business.DataSources.DatabaseConnectionDataSource.ExecuteNonQuery(String sql, IDbDataParameter[] parameters)
at Devolutions.RemoteDesktopManager.Business.DataSources.SqlServerLogSubDataSource.InsertLog(LogConnectionOpenedInfo logConnectionOpenedInfo)
Hans
edited by Rabiat on 5/9/2012
ScreenHunter_ 2012-05-09 12.09.17.jpg
I found the solution myself :)
I have copied the database from one server to another using OLEDB, and for some reason it haven't copied the columns default values.
I just add these values manually as I still have the old database.
Hans
Hi,
Sorry for the delay. I'm glad you found a solution. Let me know if I can do anything else for you.
David Hervieux
I was wondering i have got the exact same error, and i have also copied my database to another server. (exported and imported)
Which tables or columns do contain the default values?
They are SQL Server constraints, you can list them with the following query: SELECT s.name, t.name, c.name, c.definitionFROM sys.all_columns a inner join sys.tables t ON a.object_id = t.object_id inner join sys.schemas s ON t.schema_id = s.schema_id inner join sys.default_constraints c ON a.default_object_id = c.object_id
The question is why aren't they there? A simple SQL Server backup + restore will preserve all database properties. What tool are you using?
Stéfane Lavergne
this indeed seems to be the problem, there not in the 'new db' but in the 'old' they are.
I am not a DBA, however what i have done is created a new db on the new servers, and imported all the tables through the SQL management studio.
do you also happen to have a solution to copy them from the old to the new db? ;)
edited by imanb on 5/20/2014
You have a few options:
- In SSMS (SQL Server Management Studio) you can perform a backup-restore
- Use RDM to create a new the DB then use the RDM import/export to move all your sessions (http://help.remotedesktopmanager.com/index.html?tipsandtricks_data_migration.htm)
Stéfane Lavergne
I should have read the faq prior to moving the db ;)
Because the sql servers are 2 different versions i have had some problems with backup-restoring in the SSMS with some other applications however the import/export did work! and figured that for RDM it would also work :)
I let RDM create a new DB and imported the information and all works now :)
stefane thanks for the very quick response!