Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 get @return_value from stored proc using only SQL
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

fraglerock
Starting Member

2 Posts

Posted - 02/19/2008 :  12:50:01  Show Profile  Reply with Quote
Hello folks,

First I would like to apologize if this has been asked before, but you see I am in a bit of a hurry and haven't much time to read.

I need to get the @return_value of a stored procedure as part of a recordset. A custom data access layer prevents me from simply obtaining the @return_value using the regular methods.

A bit of background:
I have a static class

DB
{
public member DB.SQL //SQL Command
public method DB.Execute() //Executes SQL command, returns recordset
}


This class demonstrates the confines in which I must code. You see I only have a string of pure sql with which to obtain the @return_value of a stored proc I cannot modify. It's not right or correct, but this is the situation I find myself in.

Help

visakh16
Very Important crosS Applying yaK Herder

India
52326 Posts

Posted - 02/20/2008 :  00:04:35  Show Profile  Reply with Quote
Did you try using OUTPUT parameters in stored procedure to retrieve the values you want?

http://www.sqlservercentral.com/articles/Stored Procedures/outputparameters/1200/
http://www.devx.com/tips/Tip/13399

Edited by - visakh16 on 02/20/2008 00:05:43
Go to Top of Page

fraglerock
Starting Member

2 Posts

Posted - 02/20/2008 :  09:07:35  Show Profile  Reply with Quote
Thanks for the response.

I gave up after about an hour of research...it's not my problem anymore, but thanks for the response anyway :D
Go to Top of Page

jsmith8858
Dr. Cross Join

USA
7423 Posts

Posted - 02/20/2008 :  11:34:23  Show Profile  Visit jsmith8858's Homepage  Reply with Quote
That is the worst data access layer I have ever seen.

- Jeff
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000