| title | Step 1 Download the sample data | Microsoft Docs |
|---|---|
| ms.prod | sql |
| ms.technology | machine-learning |
| ms.date | 04/15/2018 |
| ms.topic | tutorial |
| author | HeidiSteen |
| ms.author | heidist |
| manager | cgronlun |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md-winonly]
This article is part of a tutorial, In-database Python analytics for SQL developers.
Both the data and the scripts for this tutorial are shared on Github. In this step, you use a PowerShell script to download the data and script files to a local directory of your choosing.
-
Open a Windows PowerShell command console.
Use the option, Run as Administrator, if administrative privileges are needed to create the destination directory or to write files to the specified destination.
-
Run the following PowerShell commands, changing the value of the parameter DestDir to any local directory. The default we've used here is
C:\temp\pysql.$source = 'https://raw.githubusercontent.com/Azure/Azure-MachineLearning-DataScience/master/Misc/PythonSQL/Download_Scripts_SQL_Walkthrough.ps1' $ps1_dest = "$pwd\Download_Scripts_SQL_Walkthrough.ps1" $wc = New-Object System.Net.WebClient $wc.DownloadFile($source, $ps1_dest) .\Download_Scripts_SQL_Walkthrough.ps1 –DestDir 'C:\temp\pysql'
If the folder you specify in DestDir does not exist, it will be created by the PowerShell script.
If you get an error, temporarily set the policy for execution of PowerShell scripts to unrestricted for this walkthrough, by using the Bypass argument and scoping the changes to the current session. Running this command does not result in a configuration change.
Set-ExecutionPolicy Bypass -Scope Process
-
Depending on your internet connection, the download might take a while.
When all files have been downloaded, the PowerShell script opens to the folder specified by DestDir.
-
In the PowerShell command prompt, run the following command, to list the files that were downloaded.
ls
Step 2: Import data to SQL Server using PowerShell
