Richa

Richa

  • NA
  • 18
  • 7.1k

error in Stored Procedure

Jun 18 2013 5:40 AM
i try to create a sp..



 create proc [dbo].[Usp_Register]
@Username varchar(100)
  @User_Pass varchar(100)
  @F_Name varchar(20)
  @L_Name varchar(20)
  @Address1 Varchar(200)
  @mobile varchar(20)
  @City varchar(20)
  as
   begin
   insert into User_Login
           ([Username]
           ,[User_Pass]
           ,[F_Name]
           ,[L_Name]
           ,[Address1]
           ,[mobile]
           ,[City])
     VALUES (@Username,@User_Pass,@F_Name,@L_Name,@Address1,@mobile,@City)
     declare @error_code int
     set @error_code=@@ERROR
     if(@error_code<>0)
     begin
     select 'Error!!!'
     end
     else
     begin
     select 'DONE!!!'
     end
    
     end
 



and error show...

Msg 102, Level 15, State 1, Procedure Usp_Register, Line 6
Incorrect syntax near '@F_Name'.
Msg 137, Level 15, State 2, Procedure Usp_Register, Line 21
Must declare the scalar variable "@User_Pass".

i tried but not getting why this error show?

Answers (1)