Basically when I register (Registration details goes to Login table), then this data goes to 2 tables:
- Login table
- Registration table(Specific)
Using @Attrib I check which data needs to go to which table. But here I am getting an error near the first else part.
The error is:
Incorrect syntax near ‘@Attrib’ expecting SELECT or ,'(‘
Here is the code:
ALTER procedure [dbo].[Registration_SP]
(
@Email varchar(50),
@Password varchar(50),
@Repassword varchar(50),
@Attrib varchar(50)
)
AS
BEGIN
Insert into Login (Email,Password,Repassword,Attrib)
values(@Email,@Password,@Repassword,@Attrib)
IF (@Attrib = 'Student')
BEGIN
Insert into StudentReg
(StudentId,FirstName,LastName,Gender,Address1,Address2,Address3,
LandPhone,MobilePhone,Budget,IsFinancialSupport,CourseName,
IsJobSeeker,Country,Region,IsSupportActive,RegDate,ImagePath,
ShortCode)
Values(@Email,'','','','','','','','','','','','','','','','','','')
END
ELSE (@Attrib = 'Financial Supporter')
BEGIN
Insert into SupporterReg
(SupporterId,SupporterName,University,ContactNo,StudentLocation,RegDate,
ImagePath,ShortCode)
Values(@Email,'','','','','','','')
END
Further clarification, I have atttached the image below:

Your
ELSEis missingIFafterwards:i.e.
should be