ice78991
Programmer
- Nov 20, 2006
- 216
I am trying to detect if a user name already exists in a table in a stored procedure. If it does, I want to throw an error message back to my coldfusion page. My coldfusion page calls this stored procedure within a try catch block
However,my coldfusion catch block is receiving the following error from SQL Server 2005
[Macromedia][SQLServer JDBC Driver]The DBMS returned an unspecified error. The command code was 224.
I think the problem is somewhere in the following code which is designed to exit the stored procedure if a User Name already exists
Code:
IF EXISTS (SELECT UserName FROM Users WHERE UserName = @UserName)
BEGIN
SELECT @ErrMsg = 'UserName already exists',@ErrSeverity = ERROR_SEVERITY()
RAISERROR(@ErrMsg, @ErrSeverity, 1)
RETURN
END
Can anyone see a problem here?