0

savvy people

Important: I want the R-Code to be in an external file.

I have run the R-code already succesfully. It is run in an SSIS-package within an SQL-Statment the using the @script=N'..R-code here..' argument. So far so good, with the exception that the window where the SQL statement is entered is a pain. Wrapping is weird, no code highlighting etc, which renders the whole thing basically unmaintanable.

So I would like to supply the script as VARCHAR-Variable in the following fashion @script=@loaded_script.

I tried to bulk load the script, but I get errors that the file cannot be found. Does somebody have an idea?

dmeu
  • 3,842
  • 5
  • 27
  • 43
  • I recently used the 'Execute Process Task' to run an external r script and fed the result into downstream loading process. Not sure if that helps as you wish to run it within your SQL-statement – CER Oct 16 '19 at 15:36
  • The file cannot be found as the path to the R script must be relative to the server the query is running on. Then you get to ensure the account has permissions to the path the .r file is at – billinkc Oct 16 '19 at 15:45
  • @billinkc, also if the R-script is placed in the SSIS project folder, next to the .dtsx? I kind of expected (or hoped) they can be deployed as an entire package together – dmeu Oct 17 '19 at 06:39
  • When you deploy an SSIS package, it goes to the File System or SQL Server. When using the Project Deployment Model, new and the default with 2012, SSIS projects are deployed to the Integration Services Catalog (SSISDB). The Package Deployment Model, only and default option with 2005/2008, deploys either to the MSDB or to the file system. Package Deployment model deploys individual packages. Project Deployment model deploys an ISPAC file which is a zip of all the packages, Project Connection Managers, Project Parameters, and a manifest file. – billinkc Oct 17 '19 at 13:40
  • Nowhere is there room for "other" files to be included so no, having the .r file sitting in the same folder as an SSIS package works great while you run in Visual Studio but when it's deployed, _where_ is the same folder? When it's in the database, there's no file system to find adjacent files. – billinkc Oct 17 '19 at 13:44
  • Thanks for your explanation @billinkc. I kind of expected that static files could be included for deployment. – dmeu Oct 29 '19 at 13:04

0 Answers0