I have a table. with a field ticket_no whihc is an Identity field. I want to insert a record and make the DB return the ticket_no value. But what really is happening is that its returning a WRONG value. When I insert a record it returns me and ID whihc is not the actaul ticket_no for that recordset!!<BR><BR>Here is a copy of my stored procedure<BR><BR>CREATE PROCEDURE sp02 <BR> (@user_name varchar(15),<BR> @category_id varchar(10),<BR> @title varchar(50),<BR> @subject varchar(50),<BR> @prob varchar(500),<BR> @post_date datetime,<BR> @ticket_no INT output)<BR><BR>as<BR><BR>begin<BR><BR> insert into post_ticket values (ltrim(rtrim(@user_name)),<BR> ltrim(rtrim(@category_id)), <BR> ltrim(rtrim(@title)),<BR> ltrim(rtrim(@subject)),<BR> ltrim(rtrim(@prob)), <BR> ltrim(rtrim(@post_date)))<BR> <BR> <BR> select ticket_no = @@identity<BR>end<BR>go<BR><BR>******************* *****************************<BR><BR>In my VBScript I have used the code<BR>ticket_no = = cmd.Parameters("@ticket_no").value<BR><BR>Where am I going wrong?