Hello,
We are tryng to Insert an .CSV file as a Blob object in the Table in MS SQL server.
A) SAS is installed on the UNIX sever and We are using SQL Passthrough facility to insert the file in the database table. B) We are facing an error while doing this task.
ERROR: CLI prepare error: [SAS/ACCESS][ODBC 20101 driver][Microsoft SQL Server]Cannot bulk load because the file "/opt/sasinside/SASDATA/EXPORT_LOGS/TESTEXPORT.csv" could not be opened. Operating system error code 3(failed to retrieve text for this error. Reason: 15105).
It seems like system is not able to find the path specified (Error code 3?)
To insert file as a blob in the Database, is it necessary to store the file in the same server/location? Is there any workaround to do this task?
Code Used:
proc sql; connect to sqlsvr as myconn (datasrc="MSSQLDSN" user=WinProfileSSRReader password='xxxxxxxxxxxxxxxxxx');
select * from connection to myconn (
DECLARE @file AS VARBINARY(MAX); SELECT @file = CAST(bulkcolumn AS VARBINARY(MAX)) FROM OPENROWSET( BULK '/opt/sasinside/SASDATA/EXPORT_LOGS/TESTEXPORT.csv', SINGLE_BLOB ) AS x;
/*insert into WinProfileRefUser.SSR_REPORTS (id,tnuid,FILE)*/ /* values (NEWID(),'CCCCCC',@file)*/ );
disconnect from myconn; quit;
Thanks in Advance, Nikhil
... View more