3
votes

I'm trying to run this simple Python script inside SQL Server Management Studio (SSMS) connected to my instance at AWS Relational Database Service (RDS):

EXECUTE sp_execute_external_script
@language =N'Python',
@script=N'import sys
print(sys.version)';
GO

But I'm getting the following error:

Msg 39020, Level 16, State 2, Procedure sp_execute_external_script, Line 1
Feature 'Advanced Analytics Extensions' is not installed. Please consult Books Online for more information on this feature.

So, I'd like to install 'Advanced Analytics Extensions' for SQL Server. I wasn't able to ssh into SQL Server EC2 instance and the only solution I had access so far was to install SQL Server and 'additional features' (including R and Python) on the client side.

Is there a way to enable Python script in AWS RDS or even install 'Advanced Analytics Extensions' using command EXECUTE inside SSMS ? Or maybe run SSH, get into EC2, install Python and run via SSMS interface ?

I also tried to SSH using:

ssh -N -L 22:my-rds-address.us-west-1.rds.amazonaws.com:1433 ec2-user@???server.com -i ~/ServerKey.pem

but it didn't work either, because I can't get the DNS of RDS EC2.

I could try to change this via aws cli:

aws rds modify-db-parameter-group --db-parameter-group-name groupname --parameters "ParameterName='external scripts enabled',ParameterValue=1,ApplyMethod=immediate"

but the biggest issue seems to be this: external scripts enabled / Modifiable=false:

ModifiableFalse

1
Rubens - am in the same boat, did you resolve this? - Pand005
No, I didn't because at the time of the question, AWS didn't provide sysadmin roles to DBA user, @Pand005 - razimbres

1 Answers

0
votes

We could see that ' Advanced Analytics Extensions' feature is not installed on your SQL Server. As to your question on how to install Advanced Analytics Extensions using 'EXECUTE' command, we could not find any related material.

  • When you install 'Advanced Analytics Extensions' (R Services) on SQL server, make sure to select at least one language during initial setup: either R or Python, or both.
  • After setup, to execute sp_execute_external_script, you must first enable external scripts by using the statement,
 EXEC sp_configure 'external scripts enabled', 1;  
 RECONFIGURE WITH OVERRIDE; 
 GO

This property is OFF by default.

  • Restart SQL Server to make this change effective.
  • To see the affected changes run the following command:
EXEC sp_configure  'external scripts enabled';
Go
  • After running the above command,you could see that both config_value and run_value changes to 1.
  • After the SQL Server Launchpad starts you should be able to run simple R scripts.
    Hope this helps.