Home > Archive > MS SQL Server ODBC > March 2006 > SQLExecute return code for stored procedure.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SQLExecute return code for stored procedure.
Offspring

2006-03-21, 3:24 am

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_INF
O. 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!

Offspring

2006-03-21, 3:24 am

The problem mentioned happens when using Native Client.

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com