Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I run R language to generate data and need to load this data automatically automatically in SQL Server.Is this possible?
Posted
Comments
Herman<T>.Instance 21-Jan-13 10:19am    
what have you tried?

1 solution

I like to store stuff in SQL Server tables. Data can be just about anything and it can be stored using TSQL in numerous stages of conversion in a table. Large storage is available in ntext, binary, varbinary, etc ...

But first you've gotta load ... it.
CREATE SCHEMA [rdata]
CREATE TABLE [database].[rdata].[rfile](
   [strR][nvarchar](MAX}
   )
CREATE TABLE [database].[rdata].[rfileIdx](
   [idx][int]IDENTITY(1,1)
       [strR][nvarchar](MAX)
   )
BULK INSERT [database].[rdata].[rfile]
'c:\R_data_output\filename.rrr'

INSERT INTO [database].[rdata].[rfileIdx]
   SELECT [strR] FROM [database].[rdata].[rfile]

If all goes well, you'll receive no red error messages and you'll have lines of "data" in an indexed table. I'll wager you'll run into the single line table next ...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900