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 |
stpn
Starting Member
8 Posts |
Posted - 2014-04-04 : 05:37:39
|
Hi all,I Want to write a single SP which inserts and updates.CREATE PROCEDURE sp_NewPassword@UserName nvarchar(50),@OldPassword nvarchar(50),@NewPassword nvarchar(50)ASBEGININSERT INTO RGH_ChangePassword(vUserName, vNewPassword) VALUES(@UserName, @NewPassword)UPDATE RGH_LoginMaster SET vPassword=@NewPassword WHERE vUserName=@vUserName and vPassword=@OldPasswordENDWhen i tried to create above sp it gives me an error sayingMsg 137, Level 15, State 2, Procedure sp_NewPassword, Line 8Must declare the scalar variable "@vUserName".GUIDE ME ON THIS.Thank you |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2014-04-04 : 05:42:33
|
Wouldn't it be good to use @UserName instead of @vUserName?  Too old to Rock'n'Roll too young to die. |
 |
|
|
|
|