all groups > sql server odbc > march 2006 >
You're in the

sql server odbc

group:

SQLExecute return code for stored procedure.


SQLExecute return code for stored procedure. Offspring
3/20/2006 3:36:31 PM
sql server odbc:
Hello,

For SQL Server 2000, if the stored procedure threw an error and there
was a result set available, the return code from the ODBC call
SQLExecute was SQL_SUCCESS_WITH_INFO. However, with SQL Server 2005,
return code is SQL_ERROR. Has anyone else encountered this problem? Is
this a bug or design change? Is there a new state like
SQL_ERROR_WITH_INFO?

Here is the stored procedure i am using:

create procedure testProc @p1 varchar(4) output
as INSERT INTO tbl VALUES('CY','CY')
select * from tbl
select @p1 = 'one'
return 55

table...
create table tbl (col1 varchar(5) unique, col2 varchar(5))

insert into tbl values('CY','CY')

The above stored proc, throws a primary key violation error.

Thanks!
Re: SQLExecute return code for stored procedure. Offspring
3/20/2006 3:47:36 PM
The problem mentioned happens when using Native Client.
AddThis Social Bookmark Button