Microsoft.Data.SqlClient.SqlException: Incorrect syntax near 'Studio'

I have a cross-platform project running UiPath Studio Community 2023.4.0. In the project, I use UiPath.Database.Activities (version 1.8.2) to connect to SQL Server. I use the “Run Query” activity with the SQL statement ‘SELECT * FROM [school].[dbo].[student]’. When running locally, the robot works fine. However, when I publish it to the Tenant and start a job within a Process to run the robot under a Docker container, I encounter the error:

Incorrect syntax near ‘Studio’.
Microsoft.Data.SqlClient.SqlException: Incorrect syntax near ‘Studio’. at UiPath.Database.Activities.ExecuteNonQuery.HandleException(Exception ex, Boolean continueOnError)
at UiPath.Database.Activities.ExecuteNonQuery.ExecuteInternalAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Database.Activities.AsyncTaskCodeActivity.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)
— End of stack trace from previous location —
at UiPath.Executor.BaseRunner.EndExecute(IAsyncResult result) in /home/vsts/work/1/s/Robot/UiPath.Executor.Core/WorkflowRuntime.cs:line 311
at UiPath.Executor.InProcessRunner.EndExecute(IAsyncResult result) in /home/vsts/work/1/s/Robot/UiPath.Executor.Core/WorkflowRuntime.cs:line 402
at UiPath.Core.Activities.ExecutorInvokeActivity.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)

Thanks in advance!

@Hoai_Nam,

Try getting logs to check which activity thrown this error.

Thanks,
Ashok :slight_smile:

1 Like

When you are connecting to your database, are you using an username or password, or you are using the Windows Authentication?

In the docker container, the robot is having the same version as your local robot?

I am in doubt that you have UiPath Studio Community 2023.4.0, as you should have the latest one from 2024.x.x.

1 Like

I found the problem. Thanks all

@marian.platonov, @ashokkarale

Now I have new error.
I use “Use Browser” activity to open url and get error “Exception: Could not open target application”. Do you know how to solve this problem?

Hi @Hoai_Nam ,

I believe this Error is different from the initial error stated. If your previous issue was resolved, do mark the appropriate suggestion which helped you as the Solution or if was your own finding, please do provide the steps for it and mark it as the solution.

We tend not to mix two topics or problems in a single post. You could create a new post for the other error received.

I got it. Thanks so much