“Invalid BXL stream” in MS-SQL server while executing R scripts

前端 未结 2 1746
广开言路
广开言路 2021-01-23 22:38

I am executing an R script as ms-sql stored procedure. I\'m trying to use the \"geosphere\" package, however when I execute the stored procedure, I\'m getting the error \"Invali

2条回答
  •  忘掉有多难
    2021-01-23 23:31

    I know this question is dated but I've run into the same issue multiple times so I wanted to leave my results here.

    What I've found in using sp_execute_external_script to run R and Python scripts in MS-SQL 2016/17 is that the BXL error comes for 2 different reasons

    1. Bad data types - Often, SQL doesn't understand the data types being sent out of the script. Usually explicitly casting the data as a certain datatype helps here.

    2. Bad package configuration - Certain packages in the R and Anaconda distributions don't sync well with the stored procedure since the database blocks certain dependencies in these packages. Try reinstalling the package in the SQL installed instance of R or Python.

    It seems that your problem falls in the latter category. I hope that helped!

提交回复
热议问题