I am trying to make a stored proc and SQL keeps telling me there is "Incorrect syntac near 'END'" on line 47, which is the last line of code. I do not see anything wrong, can I get second set of eyes please? ThanksCREATE PROC spMemberInfo @UpdateType AS char(6) = NULL, @UserName AS varchar(256) = NULL, @Email AS varchar(255) = NULL, @WebSite AS varchar(255) = NULL, @ContactList AS char(1) = NULL, @IsStaff AS bit = NULLASSET NOCOUNT ON;SET XACT_ABORT ON;DECLARE @ErrorNum int;BEGIN TRANSACTION--Process a new registration attemptIF (@UpdateType = 'Insert')BEGIN --Check to see if the member is already registered IF NOT EXISTS (SELECT TOP 1 1 FROM dbo.MemberInfo WITH (NOLOCK) WHERE UserName = @UserName) BEGIN INSERT INTO dbo.MemberInfo (UserName, Email, WebSite, ContactList, IsStaff) VALUES (@UserName, @Email, @WebSite, @ContactList, @IsStaff); SELECT @ErrorNum = @@ERROR; ENDELSE--Process a profile updateBEGIN UPDATE dbo.MemberInfo SET Email = @Email, WebSite = @WebSite, ContactList = @ContactList, IsStaff = @IsStaff WHERE UserName = @UserName;END--Check for errors and commit if noneIF (@ErrorNum = 0)BEGIN COMMITENDELSEBEGIN ROLLBACKEND
-- If I get used to envying others...Those things about my self I pride will slowly fade away.-Stellvia