Particular.ServiceControl service : An exception occurred when connecting to the configured SQLServer instance

Getting below error from Particular.ServiceControl log files, earlier table name was ‘dbo.PRF_Particular.ServiceControl’ which we have renamed to ‘dbo.Particular.ServiceControl’, where we need to make changes for service Particular.ServiceControl

2018-06-05 08:28:08.8632|145|Warn|NServiceBus.Transports.SQLServer.SqlServerPollingDequeueStrategy|An exception occurred when connecting to the configured SQLServer instance
System.Data.SqlClient.SqlException (0x80131904): Invalid object name ‘dbo.PRF_Particular.ServiceControl’.
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.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption)
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)

Good day Nirav

How did you change the table name?

The name of the table is derived by the instance name of Service Control. So when ServiceControl was installed someone must have used the PRF prefix in the name. Unfortunately, that name can’t be changed in the installer. So you have two options:

  1. Reinstall ServiceControl with the new name
  2. Try to override the service name

If you reinstall the service you probably want to backup the database first if you have existing messages there. Do the following:

  • Follow the instructions here Backup the ServiceControl Data • ServiceControl • Particular Docs but do not start the service again
  • Remove the instance of ServiceControl
  • Reinstall with the new name
  • Stop the service
  • Copy the backed up data into the data directory overriding the existing one in the freshly installed data directory
  • Start again

Or you can try to override the name of the service by following

Hope that helps

Regards
Daniel