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.

Output a result set to SQL Server

Output a result set to SQL Server

From the course: SQL Server Machine Learning Services: Python

Start my 1-month free trial

Output a result set to SQL Server

- [Illustrator] The Python scripts that I've shown you up to this point have simply been printing the results out to the messages window, which isn't really useful for SQL Server. In order to pass back the data in a format that can be used by SQL Server applications or reports, you'll need to convert the Python data frame back to a SQL Server results set. To do this, we need to make use of one more variable called output data set. Here's a script that we wrote in the last movie. It imports a couple of columns from the application that cities table in the wide world importers database using the select statement. It does that in the input data one property of the execute command. Then that data is stored in a data frame called input data set that we're using up here in the script. We're using the iloc property to pull out five rows starting at index position number five. We then use the print function to output the results to the messages window. If I execute the scripts, you'll see the…

Contents