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 |
yaman
Posting Yak Master
213 Posts |
Posted - 2008-04-03 : 07:27:25
|
This procedure gives a error : " Msg 245, Level 16, State 1, Procedure YAMAN, Line 16Conversion failed when converting the nvarchar value 'user' to data type int. "How can i return string valueALTER procedure [dbo].[YAMAN](@username varchar(20),@active varchar(20))asbeginif exists (select username from aspnet_Users where username=@username)begin if @active=(select active from aspnet_Users where username=@username) return 'already exist' else begin update aspnet_Users set active=@active where username=@username return 'update' end end elsereturn 'user does not exist'endYaman |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2008-04-03 : 08:37:57
|
Either return a single row, single column result set, using SELECT, or just use an output parameter.- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
X002548
Not Just a Number
15586 Posts |
Posted - 2008-04-03 : 09:28:14
|
RETURN must be supplied an int valueIn any case you shouldn't use return to try and return anythingSQL Server has the ability in certain cases to override anything you RETURNALTER procedure [dbo].[YAMAN]@username varchar(20),@active varchar(20), @rc varchar(50) OUTPUTBrett8-)Hint: Want your questions answered fast? Follow the direction in this linkhttp://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspxAdd yourself!http://www.frappr.com/sqlteam |
 |
|
|
|
|