Free tools Windows power users keep installed
One-click scans. No signup required.
There are two supported ways to use Jupyter with SQL Server: run a local Python notebook that coordinates computation on a machine-learning-enabled SQL Server, or connect to SQL Server and invoke sp_execute_external_script, which runs Python or R in the server-managed external runtime. The first route is the documented remote-client workflow for Python; the stored-procedure route supports both Python and R.
Choose the execution model first
“Send execution to SQL Server” can describe two different arrangements. Your choice determines what must be installed, where code runs, and which permissions are required.
| Aspect | Local Jupyter with remote Python client | sp_execute_external_script |
|---|---|---|
| Code authoring | Local Jupyter notebook | Notebook cell or SQL client issuing T-SQL |
| Execution | Microsoft client libraries coordinate or push computation to the remote SQL Server | SQL Server Machine Learning Services manages the external Python or R runtime |
| Primary mechanism | Microsoft machine-learning client libraries, including revoscalepy where applicable |
T-SQL procedure with @language, @script and optional SQL input |
| Languages established by the documented path | Python | Python and R |
| Main prerequisites | Matching client libraries, reachable configured server and valid authentication | Machine Learning Services, enabled external scripts, Launchpad, authentication and database permissions |
Route 1: use Jupyter as a remote Python client
Microsoft documents a workstation setup in which Jupyter runs locally and Microsoft’s client libraries coordinate work with a remote SQL Server enabled for machine-learning integration. The guide covers SQL Server 2016, 2017, 2019 and SQL Server 2019 on Linux. Treat that as the guide’s stated scope, not a universal support matrix for every newer release or platform.
Prepare the server
- Install SQL Server Machine Learning Services and the Python component on the target instance.
- Confirm that the instance is reachable from the notebook workstation through the required network and SQL Server port.
- Verify that the server edition, operating system and client-library versions are a supported combination for your release.
Prepare the notebook workstation
- Install a compatible Python environment and Jupyter.
- Install Microsoft’s machine-learning client libraries required by the documented remote workflow, including
revoscalepywhen the selected operation uses it. - Configure the notebook to connect to the remote SQL Server using its instance name, database and authentication method.
- Keep credentials out of notebooks that will be shared. Prefer an approved credential store or integrated authentication rather than a plain-text password.
Understand what this route does not establish
The cited client setup documents Python specifically. It does not establish an equivalent remote-client procedure for sending R code from Jupyter. If R is the requirement, use the in-database procedure described below unless current Microsoft documentation for your exact release provides a separate R client workflow.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Route 2: run Python or R inside SQL Server
With SQL Server Machine Learning Services installed and configured, a notebook can submit T-SQL that calls sp_execute_external_script. The code in @script runs in SQL Server’s external runtime, and @input_data_1 can supply rows from a SQL query.
Install and enable the server feature
- Install Machine Learning Services with Python, R, or both on the database instance, subject to the feature and platform support for your SQL Server release.
- On Windows, enable external scripts:
EXEC sp_configure 'external scripts enabled', 1;
RECONFIGURE;
- Restart the SQL Server database engine. This also restarts the associated Launchpad service used to host external runtimes.
- Verify that the configuration is enabled and that Launchpad is running before testing a script.
The first external-runtime call can take longer than later calls while the runtime is loaded.
Grant the required permissions
- Use a valid SQL Server login or Windows integrated authentication. Microsoft generally recommends integrated authentication, although a SQL login can be simpler in some environments.
- For a non-administrator, grant
EXECUTE ANY EXTERNAL SCRIPTin every database where external scripts will run. - Grant ordinary data permissions only as needed. For example, add reader, writer or DDL permissions when the SQL query or script actually requires those operations.
Call Python from a notebook through T-SQL
A minimal call specifies the language and script. In a real notebook, submit this SQL through your SQL Server connection rather than executing it as local Python.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
EXEC sp_execute_external_script
@language = N'Python',
@script = N'
print("Python is running in SQL Server")
';
Pass SQL data into Python
Use @input_data_1 for a relational query. The external runtime receives the resulting data frame through the procedure’s input convention.
EXEC sp_execute_external_script
@language = N'Python',
@script = N'
mean_value = InputDataSet["amount"].mean()
OutputDataSet = pandas.DataFrame({"mean_amount": [mean_value]})
',
@input_data_1 = N'
SELECT amount
FROM dbo.Sales
WHERE amount IS NOT NULL
';
The exact Python data-frame variable conventions and available packages depend on the SQL Server Machine Learning Services version and its installed runtime. Verify those details for your instance before deploying a notebook unchanged.
Call R from a notebook through T-SQL
R uses the same stored procedure but changes @language and the script syntax.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
EXEC sp_execute_external_script
@language = N'R',
@script = N'
result <- data.frame(message = "R is running in SQL Server")
OutputDataSet <- result
';
For data processing, provide a query through @input_data_1 and return a data frame through the R output convention supported by your installed version.
Control the returned result schema
Names assigned inside Python or R do not necessarily become the column headings that the SQL client displays. When consumers depend on stable names and SQL types, declare them with WITH RESULT SETS.
Do these 3 things before closing this tab:
1Repair Windows errors before they cause bigger problems2Scan for outdated or missing drivers - takes under a minute3Clear out junk files and repair common Windows errorsEXEC sp_execute_external_script
@language = N'Python',
@script = N'
OutputDataSet = pandas.DataFrame({"score": [0.97]})
'
WITH RESULT SETS ((score decimal(5,4)));
Declare every returned column with the SQL type expected by downstream queries, notebook code or applications.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Connect Jupyter safely and reliably
Authentication and network checks
- Confirm the server name, instance name, port and database from the notebook environment.
- Test the same identity with a normal SQL query before testing external scripts.
- Use integrated authentication where organizational policy supports it; otherwise protect SQL credentials with a secret manager.
- Do not embed passwords, access tokens or connection strings containing secrets in a shared notebook.
Version and platform checks
Before copying a remote-client example, record the SQL Server release, operating system, Machine Learning Services components, Python or R runtime versions and client-library versions. The older remote-client guide does not prove that one package set works unchanged with all current SQL Server releases, Linux configurations or both languages.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common failures
“External script execution is disabled”
Enable external scripts enabled, run RECONFIGURE, restart the database engine and verify the setting. Ensure the required Machine Learning Services language component was installed.
Launchpad or runtime startup errors
Check that the Launchpad service is running and that the first-call delay is not being mistaken for a query failure. Review SQL Server and Launchpad logs, then confirm that the installed runtime matches the instance configuration.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Permission denied
Grant EXECUTE ANY EXTERNAL SCRIPT in the target database to non-administrative users, then separately grant the data permissions needed by the input query or any table writes.
Connection or login failures
Validate network reachability, instance and port, authentication mode and database name. A notebook can connect successfully yet still fail to run an external script if its identity lacks database permissions.
Unexpected or missing output columns
Use WITH RESULT SETS to define names and SQL types explicitly. Do not assume a variable name created inside Python or R will be used as the SQL result heading.
Which route should you use?
- Choose the remote Python client when you specifically need Microsoft’s documented local-Jupyter-to-remote-Python workflow and your server/client combination matches its supported scope.
- Choose
sp_execute_external_scriptwhen the requirement includes R, when you want SQL Server to manage the external runtime, or when computation should execute in the database environment alongside the data.
Microsoft describes in-database execution as running scripts without moving data outside SQL Server or over the network. That benefit applies to the Machine Learning Services procedure path; it should not be generalized to every local-client workflow.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

