In this article I will explain how to resolve the following error when trying to open the Altiris Profiler.
Error: Abnormal Program Termination
Error Detail: System.InvalidOperationException: Failed to install schema: Code.Procedures.sql ---> System.Data.SqlClient.SqlException: 'TRY_CONVERT' is not a recognized built-in function name.
There is a Symantec Article based on this and with this article we will expand on this issue.
Symantec Article: https://support.symantec.com/en_US/article.TECH122018.html
Error Explanation:
When trying to open the application Altiris Profiler the application doesn't open and you are prompted with a command window with the following error:
Abnormal program termination.
----
System.InvalidOperationException: Failed to install schema: Code.Procedures.sql
---> System.Data.SqlClient.SqlException: 'TRY_CONVERT' is not a recognized built-in function name.
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)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at Altiris.Profiling.SqlSchema.SchemaInstaller.ExecuteScalar(SqlConnection connection, String text, Int32 retries)
at Altiris.Profiling.SqlSchema.SchemaInstaller.InstallSchema(SqlConnection connection, String schema)
--- End of inner exception stack trace ---
at Altiris.Profiling.SqlSchema.SchemaInstaller.InstallSchema(SqlConnection connection, String schema)
at Altiris.Profiling.CodeProfiling.SqlServerDataStoreCode.InitializeDatabase()
at Altiris.Profiling.CodeProfiling.SqlServerDataStoreCode.Connect()
at Altiris.Profiling.Framework.Modules.ProfilerModule.ConfigureDataStores()
at Altiris.Profiling.Framework.Modules.ProfilerModule.Initialize()
at Altiris.Profiling.EntryPoint.InitializeProfilerModule(ProfilerApplicationapplication, Boolean& bootUi, Int32& exitCode)
at Altiris.Profiling.EntryPoint.Main(String[] args)
----
The article from Symantec explains that there is a registry key that is incorrect, however when we got to this there was no registry key. The next steps to resolve this issue are below.
Error Resolution:
Open Registry Editor (regedit) and navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Profiler.
Check for a registry key called ConnectionString, if there isn't a key called ConnectionString then create one by Right Clicking the white space within Profiler and selecting String Value, as shown below.
Name the registry key ConnectionString
Set the Value Data as: ConnectionString="Data Source=<SQLServerName>\<InstanceName>;Initial Catalog=<DatabaseName>;Integrated Security=SSPI;"
The data within the <> needs to be related your connection string which you use to connect to your SQL database.
An example of this would be: ConnectionString="SERVER=SQLServer01;DATABASE=CMDB01;Integrated Security=SSPI;"
Now try opening Altiris Profiler again and it will open successfully if the connection string is correct.
Thanks for your time!