This is my first stored procedure so go easy on me. Procedure runs
fine except I can't get a value into the return value @RecordCount.

CREATE PROCEDURE sp_AddCustomer
@FirstName char(30),
@LastName char(30),
@EmailAddress char(30),
@Address char(30),
@Address2 char(30),
@City char(30),
@State char(30),
@Zip char(30),
@Country char(30),
@PhoneNumber char(30),
@CustomerURL char(30),
@Newsletters char(30),
@RecordCount Int OUTPUT
As
-- Check to see if email address is already in the database
IF exists(SELECT * FROM Customers WHERE EmailAddress = @EmailAddress)
BEGIN -- update customer info
SET NOCOUNT ON
-- remove previous subscriptions
DELETE FROM SubscribedNewsletters Where CustomerId=(SELECT CustomerId
FROM Customers WHERE EmailAddress=@EmailAddress)
END
ELSE
BEGIN
SET NOCOUNT ON
IF @EmailAddress <> ''
BEGIN -- add new customer to database
INSERT INTO
Customers(FirstName,LastName,EmailAddress,Address, Address2,City,State,Zip,Country,PhoneNumber,Custom erURL)

VALUES
(@FirstName,@LastName,@EmailAddress,@Address,@Addr ess2,@City,@State,@Zip,@Country,@PhoneNumber,@Cust omerURL)
END
END

-- Get Current CustomerId and Loop through adding Subscribed
Newsletters
DECLARE @CustId AS Int

SELECT @CustId = (SELECT CustomerId FROM Customers WHERE
EmailAddress=@EmailAddress)
IF (@CustId IS NOT NULL)
BEGIN
-- @Array is the array we wish to parse
-- @Separator is the separator charactor such as a comma
declare @separator_position int -- This is used to locate each
separator character
declare @array_value varchar(1000) -- this holds each array value as
it is returned
declare @array varchar(1000)
declare @separator char(1)

-- For my loop to work I need an extra separator at the end. I
always look to the
-- left of the separator character for each array value
set @separator = ','
set @array = @Newsletters + @separator

-- Loop through the string searching for separtor characters
while patindex('%' + @separator + '%' , @array) <> 0
begin

-- patindex matches the a pattern against a string
select @separator_position = patindex('%' + @separator + '%' ,
@array)
select @array_value = left(@array, @separator_position - 1)

-- This is where you process the values passed.
-- Replace this select statement with your processing
-- @array_value holds the value of this element of the array
-- select Array_Value = @array_value
INSERT INTO SubscribedNewsletters(NewsletterId,CustomerId) VALUES
(@array_value,@CustId)

-- This replaces what we just processed with and empty string
select @array = stuff(@array, 1, @separator_position, '')
end
END
-- Pull recordset of available newsletters
SELECT NewsletterId, NewsletterTitle FROM Newsletters
SELECT @RecordCount =(SELECT COUNT(*) AS CNT FROM Newsletters)
GO



----------------------------
On the ASP page I have:

set addCustomer = Server.CreateObject("ADODB.Command")
addCustomer.ActiveConnection = MM_connSQL_STRING
addCustomer.CommandText = "dbo.sp_AddCustomer"
addCustomer.Parameters.Append
addCustomer.CreateParameter("@RETURN_VALUE", 3, 4,10)
addCustomer.Parameters.Append addCustomer.CreateParameter("@FirstName",
129, 1,30,addCustomer__FirstName)
addCustomer.Parameters.Append addCustomer.CreateParameter("@LastName",
129, 1,30,addCustomer__LastName)
addCustomer.Parameters.Append
addCustomer.CreateParameter("@EmailAddress", 129,
1,30,addCustomer__EmailAddress)
addCustomer.Parameters.Append addCustomer.CreateParameter("@Address",
129, 1,30,addCustomer__Address)
addCustomer.Parameters.Append addCustomer.CreateParameter("@Address2",
129, 1,30,addCustomer__Address2)
addCustomer.Parameters.Append addCustomer.CreateParameter("@City", 129,
1,30,addCustomer__City)
addCustomer.Parameters.Append addCustomer.CreateParameter("@State",
129, 1,30,addCustomer__State)
addCustomer.Parameters.Append addCustomer.CreateParameter("@Zip", 129,
1,30,addCustomer__Zip)
addCustomer.Parameters.Append addCustomer.CreateParameter("@Country",
129, 1,30,addCustomer__Country)
addCustomer.Parameters.Append
addCustomer.CreateParameter("@PhoneNumber", 129,
1,30,addCustomer__PhoneNumber)
addCustomer.Parameters.Append
addCustomer.CreateParameter("@CustomerURL", 129,
1,30,addCustomer__CustomerURL)
addCustomer.Parameters.Append
addCustomer.CreateParameter("@Newsletters", 129,
1,30,addCustomer__Newsletters)
addCustomer.Parameters.Append
addCustomer.CreateParameter("@RecordCount", 3, 2,10)
addCustomer.CommandType = 4
addCustomer.CommandTimeout = 0
addCustomer.Prepared = true
rsNewsletters = addCustomer.Execute()

rsNewsletters_numRows = 0

Response.Write(addCustomer.Parameters.Item("@Recor dCount").Value)

Any help would be greatly appreciated!!!!