From the course: SQL Server Machine Learning Services: Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use variables in Python

Use variables in Python

From the course: SQL Server Machine Learning Services: Python

Start my 1-month free trial

Use variables in Python

- [Instructor] Every Python script that you'll write in SQL Server is going to start the same way. You'll start up a new query window, and you'll execute a stored procedure called sp_execute_external_script. This stored procedure has two required arguments. One is called @language and the other is @script. The language argument will always be set to equals Python. Remember that this is a Unicode text value, so include the capital letter N prefix and wrap the text in single quotation marks. Also be sure to include the comma at the end to separate these two arguments. The script argument also gets specified as Unicode text with the N prefix. Then any Python code that you want to execute will be placed inside of a pair of single quotation marks. So this is going to be the starting point for every script that we'll write moving forward. The only thing that we need to worry about is what's between these two single quotation marks, starting on line number four. Using the print function, we…

Contents