Skip to content

Commit 0b89d5f

Browse files
committed
tested rx functions on enabled server
1 parent 452b368 commit 0b89d5f

5 files changed

Lines changed: 138 additions & 100 deletions

docs/advanced-analytics/r/determine-which-packages-are-installed-on-sql-server.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For more information about the optional and default fields for the R package DES
4646

4747
If you have installed a package and want to make sure that it is available to a particular SQL Server instance, you can execute the following stored procedure call to load the package and return only messages. This example looks for and loads the RevoScaleR library, if available.
4848

49-
```SQL
49+
```sql
5050
EXEC sp_execute_external_script @language =N'R',
5151
@script=N'library("RevoScaleR")'
5252
GO
@@ -85,6 +85,27 @@ rxFindPackage(RevoScaleR, "local")
8585
packageVersion("RevoScaleR")
8686
```
8787

88+
## Determine path of library used by SQL Server
89+
90+
If you have upgraded the machine learning components using binding, the path to the R library might change. When this happens, previous shortcuts to R tools might reference an earlier version. To be sure of the path and package version used by SQL Server, you can run a command such as the following:
91+
92+
```sql
93+
EXEC sp_execute_external_script
94+
@language =N'R',
95+
@script=N'
96+
sql_r_path <- rxSqlLibPaths("local")
97+
print(sql_r_path)
98+
version_info <-packageVersion("RevoScaleR")
99+
print(version_info)'
100+
```
101+
102+
**Results**
103+
104+
```text
105+
STDOUT message(s) from external script:
106+
[1] "C:/Program Files/Microsoft SQL Server/MSSQL14.MSSQLSERVER1000/R_SERVICES/library"
107+
[1] '9.2.1'
108+
```
88109
## See also
89110

90111
[Install additional R packages on SQL Server](install-additional-r-packages-on-sql-server.md)

0 commit comments

Comments
 (0)