Run SQL Script from App Studio

Hi,

I am using latest Kinetic release and inquiring what is the best alternative to run SQL script in order to Execute a Stored Procedure on on the database.

Ramy Essam

The best answer is almost always going to be don’t do it.

The Rock Reaction GIF by WWE


That being said, sometimes people have a good or at least plausible reason for their requests, so please explain exactly why you want to do this.

4 Likes

The best alternative is to create and call a function.

You should be able to do what the stored procedure is doing in a function.

5 Likes

We are in the process of upgrading from Epicor 10.x to latest Kinetic release for a client where there are customizations with extensive C# code is developed to interact with an external web application.
Please note that we do not apply any changes to Epicor database schema we just need to manipulate tables in another outside database schema.

Ramy

1 Like

Please advise what type of function.

We are in the process of upgrading from Epicor 10.x to latest Kinetic release for a client where there are customizations with extensive C# code is developed to interact with an external web application.
Please note that we do not apply any changes to Epicor database schema we just need to manipulate tables in another outside database schema.

Ramy

You could use Epicor Functions in one of following ways.

  1. SqlClient for queries. I am using external data source to not have connection details hardcoded.
  2. ‘Proxy’ for your web app (if the web application has an API)
  3. External dll (adapter) for your web app. All code there, you just use it in function (if you are on premise)

OR

If that external web application has an API then you can make requests directly from Kinetic App

4 Likes

Epicor Functions.

You should be able to do everything that the extensive C# code is doing there.

1 Like

Thanks