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 |
|
Razmo
Starting Member
5 Posts |
Posted - 2010-05-05 : 11:31:10
|
| I'm having problems viewing the results of a return value from a procedure. This is the procedure:CREATE PROCEDURE usp_GetCountyName ( @nStateID INT, @nCountyID INT, @cCountyName NVARCHAR(50) OUTPUT)AS SELECT @cCountyName = Name FROM County WHERE State_ID = @nStateID AND County_ID = @nCountyIDGOThis is the table containing the data:State_ID County_ID Name 64 32 SALT LAKEThis compiles without complaints.This is how I'm executing:DECLARE @cName NVARCHAR(50), @cCountyName NVARCHAR(50)EXECUTE usp_GetCountyName @nStateID = 64, @nCountyID = 32, @cCountyName = '' SELECT @cName = @cCountyName print @cNameGONo results are returned. ??? |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-05 : 11:39:51
|
[code]DECLARE @cName NVARCHAR(50), @cCountyName NVARCHAR(50)EXECUTE usp_GetCountyName@nStateID = 64,@nCountyID = 32,@cCountyName = @cName OUTPUTSELECT @cName = @cCountyNameprint @cName[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Razmo
Starting Member
5 Posts |
Posted - 2010-05-05 : 11:48:40
|
| That worked great! Thank you for your assistance. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2010-05-05 : 11:49:55
|
you are welcome KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
|
|
|
|
|