Skip to content

Commit 35c2e88

Browse files
committed
Update Grant user permission for Q4 content performance
1 parent 4e910a1 commit 35c2e88

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
---
2-
title: Grant permissions for scripts
3-
description: How to grant database user permissions for R and Python script execution on SQL Server Machine Learning Services.
2+
title: Grant permissions to execute Python and R scripts
3+
description: Learn how you can give users permission to run external Python and R scripts in SQL Server Machine Learning Services and give read, write, or data definition language (DDL) permissions to databases.
44
ms.prod: sql
55
ms.technology: machine-learning
6-
7-
ms.date: 10/17/2018
6+
ms.date: 06/03/2020
87
ms.topic: conceptual
98
author: dphansen
109
ms.author: davidph
11-
ms.custom: seo-lt-2019
10+
ms.custom: seo-lt-2019, contperfq4
1211
monikerRange: ">=sql-server-2016||>=sql-server-linux-ver15||=sqlallproducts-allversions"
1312
---
14-
# Give users permission to SQL Server Machine Learning Services
13+
# Grant users permission to execute Python and R scripts with SQL Server Machine Learning Services
1514
[!INCLUDE[appliesto-ss-xxxx-xxxx-xxx-md](../../includes/appliesto-ss-xxxx-xxxx-xxx-md.md)]
1615

17-
This article describes how you can give users permission to run external scripts in SQL Server Machine Learning Services and give read, write, or data definition language (DDL) permissions to databases.
16+
Learn how you can give users permission to run external Python and R scripts in [SQL Server Machine Learning Services](../sql-server-machine-learning-services.md) and give read, write, or data definition language (DDL) permissions to databases.
1817

1918
For more information, see the permissions section in [Security overview for the extensibility framework](../../machine-learning/concepts/security.md#permissions).
2019

2120
<a name="permissions-external-script"></a>
2221

2322
## Permission to run scripts
2423

25-
If you installed [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] yourself, and you are running R or Python scripts in your own instance, you typically execute scripts as an administrator. Thus, you have implicit permission over various operations and all data in the database.
24+
For each user who use Python or R with SQL Server Machine Learning Services, and who are not an administrator, you must grant them the permission to run external scripts in each database where the language is used.
2625

27-
Most users, however, do not have such elevated permissions. For example, users in an organization who use SQL logins to access the database generally do not have elevated permissions. Therefore, for each user who is using R or Python, you must grant users of Machine Learning Services the permission to run external scripts in each database where the language is used. Here's how:
26+
To grant permission to execute external script, run the following script:
2827

2928
```sql
3029
USE <database_name>
@@ -33,15 +32,19 @@ GRANT EXECUTE ANY EXTERNAL SCRIPT TO [UserName]
3332
```
3433

3534
> [!NOTE]
36-
> Permissions are not specific to the supported script language. In other words, there are not separate permission levels for R script versus Python script. If you need to maintain separate permissions for these languages, install R and Python on separate instances.
35+
> Permissions are not specific to the supported script language. In other words, there are not separate permission levels for R script versus Python script.
3736
38-
<a name="permissions-db"></a>
37+
<a name="permissions-db"></a>
3938

4039
## Grant databases permissions
4140

4241
While a user is running scripts, the user might need to read data from other databases. The user might also need to create new tables to store results, and write data into tables.
4342

44-
For each Windows user account or SQL login that is running R or Python scripts, ensure that it has the appropriate permissions on the specific database: `db_datareader` to read data, `db_datawriter` to save objects to the database, or `db_ddladmin` to create objects such as stored procedures or tables containing trained and serialized data.
43+
For each Windows user account or SQL login that is running R or Python scripts, ensure that it has the appropriate permissions on the specific database:
44+
45+
+ `db_datareader` to read data.
46+
+ `db_datawriter` to save objects to the database.
47+
+ `db_ddladmin` to create objects such as stored procedures or tables containing trained and serialized data.
4548

4649
For example, the following [!INCLUDE[tsql](../../includes/tsql-md.md)] statement gives the SQL login *MySQLLogin* the rights to run T-SQL queries in the *ML_Samples* database. To run this statement, the SQL login must already exist in the security context of the server.
4750

@@ -53,4 +56,4 @@ EXEC sp_addrolemember 'db_datareader', 'MySQLLogin'
5356

5457
## Next steps
5558

56-
For more information about the permissions included in each role, see [Database-level roles](../../relational-databases/security/authentication-access/database-level-roles.md).
59+
For more information about the permissions included in each role, see [Database-level roles](../../relational-databases/security/authentication-access/database-level-roles.md).

0 commit comments

Comments
 (0)