08-30-2017 06:14 AM
I am trying to insert a data in SQL server table using SAS
Below is the code that I have written
LIBNAME LZZ OLEDB BULKLOAD=YES
'Persist Security Info'=TRUE
INSERT INTO LZZ.CUST_DIM
,COMPAREDATASETVAR FROM FINAL;
This is the error that comes up
ERROR: Execute error: IRowsetFastLoad::InsertRow failed. : Unspecified error
ERROR: ROLLBACK issued due to errors for data set LZZ.CUST_DIM.DATA.
08-30-2017 06:47 AM
options msglevel=i sastrace=',,,d' sastraceloc=saslog;
Might give you some more info in the log.
Check the data and try to see if they break any constraints, or if you have any read only columns.
Check in SQL Server logs, enable additional audit if necessary.
08-30-2017 10:31 AM - edited 08-30-2017 12:25 PM
Most likely you have a type conflict for one of the column or perhaps just one of the values for one of the columns.
Find an example observation that it cannot insert.
Then repeatally try loading the row with different combinations of variables selected to see which variable(s) are causing the problem.
You should probably check the date varaibles first. SAS stores DATE and DATETIME values differently, but many DBMS have only one data type for dates. You might need to convert your SAS DATE value to a DATETIME value to put it into the target variable.