I am trying to run an Execute Query activity from the UiPath Database Activities package (v1.4.0) and I’m getting this error that doesn’t make any sense to me.
RemoteException wrapping System.Data.SqlClient.SqlException: Invalid column name ‘N’.
Invalid column name ‘A’.Server stack trace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.SqlInternalConnection.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, 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, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at UiPath.Database.DatabaseConnection.ExecuteQuery(String sql, Dictionary
2 parameters, Int32 commandTimeout, CommandType commandType)
at UiPath.Database.Activities.ExecuteQuery.<>c__DisplayClass38_0.b__0()
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object args, Object server, Object& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)Exception rethrown at [0]:
at UiPath.Database.Activities.ExecuteQuery.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
A couple of things to address first, I have run a modified version of this SQL in another process of mine and I do not notice this error. The server/datatable remains the same, the only things I tweaked were a few data columns and one of the AND conditions for the SQL pull. I ensured that the connection was formatted properly and I know there is nothing wrong with the SQL itself because I threw it in SQL studio and it ran just fine. When debugging and reviewing the Locals tab, nothing jumped out to me except at the very beginning, before the first quotation mark, there was an @ sign for whatever reason. I did whatever I could to remove that from the SQL string but that didn’t do anything either.
I can make the details available upon request because I don’t want to put anything work related on the public forum. I’m mainly just wondering if anyone has experienced something like this and if there is a way to fix this because I’m stumped. This particular SQL already works on another, more complex, process and now I can’t get it to go on a simpler one.