Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to Set value from another sp in SQL Expand / Collapse
Author
Message
Posted Wednesday, April 24, 2013 4:53 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 5:26 AM
Points: 91, Visits: 162
Hi All,

I am trying to write an SP but stucked. in a situation I am trying to set sub_serial_no and for that I have written

SET @sub_serial_no = (exec GetSubmissionSerialNumber 1)

if I execute only exec GetSubmissionSerialNumber 1 then I am getting the value but when I run the above sp it shows me.

I want to set @sub_serial_no by calling the earlier sp (GetSubmissionSerialNumber)

How do I set that?


Please help!!
Post #1445852
Posted Wednesday, April 24, 2013 5:17 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 2:57 AM
Points: 704, Visits: 3,270
Read this: http://msdn.microsoft.com/en-gb/library/ms187004(v=sql.105).aspx

---------------------------------------------------------


It takes a minimal capacity for rational thought to see that the corporate 'free press' is a structurally irrational and biased, and extremely violent, system of elite propaganda.
David Edwards - Media lens

Society has varying and conflicting interests; what is called objectivity is the disguise of one of these interests - that of neutrality. But neutrality is a fiction in an unneutral world. There are victims, there are executioners, and there are bystanders... and the 'objectivity' of the bystander calls for inaction while other heads fall.
Howard Zinn
Post #1445862
Posted Wednesday, April 24, 2013 7:08 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 10,907, Visits: 12,539
The recommended method for returning a single value from a stored procedure is to use an output parameter. Which I'm sure is what the link provided in the previous post points to.



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #1445941
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse