0

I am making an application, I would like to be able to get a script to put data into the database, but i was wondering can i get SQL to Launch a C# application to get information from the web and return that into the database without having to interact with the SQL database.

Realistically I would like the operation to run like so:

Query -> Launch c# -> input the data to DB

but i would like this all to work from the initial procedure, is something like this possible?

3
  • Does this answer your question? How to run a program from SQL? Commented Jan 9, 2020 at 8:02
  • 8
    DBAs everywhere will genuinely hate you if you do this... in almost any scenario, the flow should be "C# fetches / formats data from external source -> C# invokes SQL -> SQL stores (or whatever) the data". There is a capability to run .NET directly inside SQL Server, but : that is also no longer recommended, and is disabled by default on new versions, IIRC Commented Jan 9, 2020 at 8:04
  • Look at Sql clr integration learn.microsoft.com/en-us/sql/relational-databases/… Commented Jan 9, 2020 at 8:13

1 Answer 1

1

It it not favoured practice but you can use the below stored procedure to call a C# executable. Some times it is unavoidable if you are constrained.

xp_cmdshell { 'command_string' } [ , no_output ]  

You can find the documentation here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.