From the course: SQL Server Machine Learning Services: R

Unlock the full course today

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

Write your first R script

Write your first R script

From the course: SQL Server Machine Learning Services: R

Start my 1-month free trial

Write your first R script

- [Instructor] Every R script that you write in SQL server will start the same way, you'll execute a stored procedure called SP execute external script. This stored procedure has two required arguments, one called @language and one called @script. The language argument will always be set to R. Remember that this is a Unicode text value, so include the capital N prefix and wrap the text in single quotation marks. Then because we're supplying two different parameters, you need to make sure that there's a comma at the end of the language parameter. That'll separate the language parameter from the script parameter. The script argument will also get specified as Unicode text, so we'll include that capital N prefix. Then inside of single quotation marks, we'll place our R code. So this is going to be the starting point for every script that we write moving forward. What's on the screen right now is all transact SQL syntax, so…

Contents