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 - 2007-08-17 : 15:14:59
|
I have a stored procedure that will return a single result of NVARCHAR(12). I want to load that result into a variable from within another Stored Procedure. How can I do that? I have been trying variations of the following so far:DECLARE @Variable NVARCHAR(12)SELECT @Variable = EXEC [dbo].[spName] Edit: By the way, the Stored Procedure being called does not accept any parameters, but it would be interesting to know how to if one needed to.- - - -- Will -- - - -http://www.strohlsitedesign.comhttp://blog.strohlsitedesign.com/http://skins.strohlsitedesign.com/ |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-17 : 15:20:34
|
CREATE TABLE #Temp (i nvarchar(12))insert #temp exec spnameselect @variable = i from #temp E 12°55'05.25"N 56°04'39.16" |
 |
|
|
hismightiness
Posting Yak Master
164 Posts |
Posted - 2007-08-17 : 15:31:54
|
| That doesn't appear to be very efficient. Is that my only option?- - - -- Will -- - - -http://www.strohlsitedesign.comhttp://blog.strohlsitedesign.com/http://skins.strohlsitedesign.com/ |
 |
|
|
Lamprey
Master Smack Fu Yak Hacker
4614 Posts |
Posted - 2007-08-17 : 16:48:24
|
| I think you should be able to use an OUTPUT parameter. |
 |
|
|
|
|
|