Problem Note 36104: Dynamic cursors used for global and shared OLE DB connections do not work when you call Microsoft SQL Server stored procedures with temporary tables
SAS/ACCESS® 9.1.3 Interface to OLE DB can call MS SQL Server stored procedures with temporary tables.
When you call the same stored procedure in SAS® 9.2, the following error is returned:
ERROR: Prepare error: ICommand::Execute failed. : Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
SQL statement: spTempTablTest #DatesMinp.
SAS 9.2 forces the use of the dynamic cursor with a global connection, but the cursor does not work.
Currently, there is no a way to override this behavior.
Operating System and Release Information
SAS System | SAS/ACCESS Interface to OLE DB | Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows XP 64-bit Edition | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft® Windows® for x64 | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS1M0 | 9.2 TS2M2 |
Microsoft Windows XP Professional | 9.2 TS1M0 | 9.2 TS2M2 |
Windows Vista | 9.2 TS1M0 | 9.2 TS2M2 |
*
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.
This code was provided by the reporting site.
%let ConnType=global;
libname dblib
oledb Provider=SQLOLEDB
PROVIDER_STRING="Server=SQL_Server;Database=data;Trusted_Connection=yes"
connection=&ConnType
;
data dblib.'#TableName'n;
format date datetime20.;
date = "31JAN2009 00:00"DT ;
run;
proc sql;
Connect to oledb AS dblib (
PROVIDER=SQLOLEDB OLEDB_SERVICES=NO
PROVIDER_STRING="SQL_Server;Database=data;Trusted_Connection=yes"
connection=&ConnType
);
/* using temp table works in selects */
create table A as Select * from connection to dblib ( select * from #TableName);
/* now call sql server stored proc to select from temp table */
create table B as Select * from connection to dblib ( spTempTablTest '#TableName' );
execute ( drop table #TableName ) by dblib;
quit;
libname dblib Clear;
Type: | Problem Note |
Priority: | high |
Topic: | Data Management ==> Data Sources ==> External Databases ==> OLEDB
|
Date Modified: | 2009-09-09 12:49:13 |
Date Created: | 2009-06-01 08:54:04 |