Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
hismightiness
Posting Yak Master
164 Posts |
Posted - 2008-08-20 : 16:56:40
|
| How do you load a SProc result into a variable? For instance, let's say a SProc returns an Integer value. How do you load that into a local variable?DECLARE @Var INT;SELECT @Var = EXEC sp_ReturnAnInt32(N'input value');- - - -- Will -- - - -http://www.strohlsitedesign.comhttp://blog.strohlsitedesign.com/http://skins.strohlsitedesign.com/ |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2008-08-20 : 17:00:57
|
| 1. Never use sp_ as a prefix for your stored procedures2. EXEC @var = sp_ReturnAn Int32(...)3. But better yet, use OUTPUT parameters instead of RETURN codes. Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/Subscribe to my blog |
 |
|
|
hismightiness
Posting Yak Master
164 Posts |
Posted - 2008-08-20 : 22:14:23
|
| Tara:I used sp_ only for effect. I am aware of the conflicts that will possibly occur otherwise.Thanks! This will work.- - - -- Will -- - - -http://www.strohlsitedesign.comhttp://blog.strohlsitedesign.com/http://skins.strohlsitedesign.com/ |
 |
|
|
|
|
|