SUPPORT / SAMPLES & SAS NOTES
 

Support

Problem Note 16053: "Error binding parameters: [ODBC SQL Server Driver] Attempt to bulk-copy a NULL value into a Server column which does not accept NULL values"

DetailsHotfixAboutRate It

When inserting data into a SQL Server column with the BCP option and not explicitly specifying the literal value in the INSERT statements, you receive the following error:

  ERROR: Error binding parameters: [Microsoft][ODBC SQL Server
  Driver]Attempt to bulk-copy a NULL value into a Server column which
  does not accept NULL values
  ERROR: ROLLBACK issued due to errors for data set
  MYDB.cwddefault.DATA.

For example, the table definition for CWDDEFAULT is as follows:

create table cwddefault (col1 int, col2 int not null default 0) /* Create a SAS data set containing data to be loaded into the dbms table */ libname mydb odbc dsn=sqdb uid=dbitest pwd=dbigrp1 bcp=yes; data foo; col1=1;output; col1=2;output; run; /* Insert records into the dbms table */ proc sql; insert into x.cwddefault(col1) select * from foo; quit;

This SAS code generates the above error.

This will be fixed in SAS 9.2. The current workaround is to use a literal "0" inside the select statement. For example:

  proc sql;
  insert into x.cwddefault(col1, col2) select col1, 0 from foo;
  quit;

Select the Hot Fix tab in this note to access the hot fix for this issue.



Operating System and Release Information

Product FamilyProductSystemSAS Release
ReportedFixed*
SAS SystemSAS/ACCESS Interface to ODBCMicrosoft Windows XP Professional9.1 TS1M39.2 TS1M0
Microsoft Windows XP 64-bit Edition9.1 TS1M39.2 TS1M0
Microsoft® Windows® for 64-Bit Itanium-based Systems9.1 TS1M39.2 TS1M0
Microsoft Windows Server 2003 Standard Edition9.1 TS1M39.2 TS1M0
Microsoft Windows 2000 Server9.1 TS1M39.2 TS1M0
Microsoft Windows Server 2003 Datacenter Edition9.1 TS1M39.2 TS1M0
Microsoft Windows Server 2003 Enterprise Edition9.1 TS1M39.2 TS1M0
Microsoft Windows 2000 Advanced Server9.1 TS1M39.2 TS1M0
Microsoft Windows 2000 Datacenter Server9.1 TS1M39.2 TS1M0
Microsoft Windows 2000 Professional9.1 TS1M39.2 TS1M0
* For software releases that are not yet generally available, the Fixed Release is the software release in which the problem is planned to be fixed.