I have a table in sql-server-2016:
CREATE TABLE
INSERT INTO
GO
Now I can call my R-script table as input (including column names):
EXECUTE sp_execute_external_script
@language = N'R'
, @script = N'
df <- InputDataSet
df$B <- 1L'
, @input_data_1 = N'SELECT * FROM #tempData'
, @output_data_1_name = N'df'
WITH RESULT SETS (
(A int not null, B int not null)
);
Return:
A B
0 1
as was expected. But can I do the same without specifying the names {A, B}, i.e. Use names directly from data.frame.
source
share