I would like to use a variable in my INSERT command. This variable includes result value from a storedprocedure:
declare @File as varbinary(max)
exec @File=[dbo].[MySp]
but If I use @File
in an INSERT command, another value of is written in table
insert into [dbo].[Plots] values ('test', @File)
My Stored Procedure:
CREATE PROCEDURE [MySp]
AS
BEGIN
EXEC sp_execute_external_script @language = N'R'
, @script = N'_RCODE_'
, @input_data_1 = N'_INPUT_QUERY_'
,@output_data_1=N'OutputDataset'
--- Edit this line to handle the output data frame.
WITH RESULT SETS (([plot] VARBINARY(max)));
END;