0

How can I execute python project, which is hosted on remote desktop from my local SQL server management studio (ideally from stored procedure). I tried to look Run Python Script from MSSQL into this but I am not aware of how to use it.

The python script ideally has some print statement, ideally I should able to read those print statements from SQL server too

4
  • If the script is stored elsewhere, you could use something like OPENROWSET to put the contents of the file in a variable, and then execute the Python using sys.sp_execute_external_script. Commented Oct 7, 2021 at 10:02
  • The main file internally uses multiple other python files, hence putting contents in variable can't be used Commented Oct 7, 2021 at 10:11
  • "How can I execute python script file" emphasis on singular file... if you want to run a python file that is part of a project, that is very different. This doesn't sound like this is a task for SQL Server any more. sys.sp_execute_external_script can't call files. Commented Oct 7, 2021 at 10:12
  • Any idea if we can do this by using sql jobs? Commented Oct 7, 2021 at 10:17

0

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.