Sorry to bother you with thi one again Michael. I am having difficulty executing the stored procedure. When I pasted in your code everythuing worked fine; however when I try to execute my stored procedure I get the error:
Procedure 'up_C_TB_InsertNewClient' expects parameter '@newID', which was not supplied.
My code for the stored procedure is as follows:
CREATE PROCEDURE up_C_TB_InsertNewClient
@newID int OUTPUT,
@LName varchar,
@FName varchar,
@Gender int,
@DOB smalldatetime
AS
INSERT INTO tblClientInfo
(LastName, FirstName, GenderID, DOB)
VALUES
(@LName, @FName, @Gender, @DOB)
IF @@ERROR <> 0
BEGIN
RETURN -1
END
SET @newID = SCOPE_IDENTITY()
RETURN 0
GO
I am trying to execute with the following command in Query Analyzer:
EXEC up_C_TB_InsertNewClient @LName='Ruxpin', @FName='Teddy', @Gender=1, @DOB='01/oct/1974'
I haven't been able to find any help in Books Online so if you ahve any suggestions I would appreciate it. Thanks again.