Unix Technical Forum

SQLExecute return code for stored procedure.

This is a discussion on SQLExecute return code for stored procedure. within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hello, For SQL Server 2000, if the stored procedure threw an error and there was a result set available, ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 10:08 PM
Offspring
 
Posts: n/a
Default SQLExecute return code for stored procedure.

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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 10:08 PM
Offspring
 
Posts: n/a
Default Re: SQLExecute return code for stored procedure.

The problem mentioned happens when using Native Client.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:14 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com