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 |
|
lalle
Starting Member
3 Posts |
Posted - 2003-10-27 : 08:32:49
|
| Hi!I call a sp from another sp, the child-sp returns a char(12), how to catch the string in the parent (calling sp)?Cheers,lalle |
|
|
raymondpeacock
Constraint Violating Yak Guru
367 Posts |
Posted - 2003-10-27 : 09:23:14
|
| Use a char(12) OUTPUT parameter in the parent SP's call to the child SPRaymond |
 |
|
|
MakeYourDaddyProud
184 Posts |
Posted - 2003-10-27 : 09:26:39
|
| Also, remember that you cannot "return" anything other than an int datatype from a procedure, that is, using the return @variable format.Daniel Small MIAPwww.danielsmall.com IT Factoring |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2003-10-27 : 12:05:50
|
quote: Originally posted by danny2sweet Also, remember that you cannot "return" anything other than an int datatype from a procedure, that is, using the return @variable format.
I guess that could be a bit misleading...Daniel is refering to The RETURN keyword...CREATE PROC mySproc @x varchar(26) OUTPUTASDECLARE @RC int SELECT @x = CONVERT(varchar(26),GetDate()) SELECT @RC = @@ERROR IF @RC <> 0 SELECT @RC = -1 RETURN @RCGODECLARE @x varchar(26), @RC int EXEC @RC=mySPROC @x OUTPUT SELECT @x, @RCGODROP PROC mySPROCGO Don't forget your error handling...Brett8-) |
 |
|
|
|
|
|