Hi iam new to stored procedures... <BR><BR>I would like to insert alot of values in to a database and then return the ID och the just inserted record... I have read som FAQ´s and come up with the following soultion. AND IT WORKS... <BR><BR>But the problem is that in this code/exampel i have to code lots of statments if i would like to insert all those values i would like to post. IS there a way to save redundent code here ? <BR><BR>&#039;************************************ ******&#039; <BR>&#039;*** Declare variables ***&#039; <BR>&#039;**************************************** **&#039; <BR><BR>dim dataConn, adocmd, IsValid <BR><BR>test = "This is a test" <BR><BR>set dataConn = Server.CreateObject("ADODB.Connection") <BR>dataConn.Open "DSN=test" &#039;make connection <BR><BR><BR>&#039;******************************** **********&#039; <BR>&#039;*** EXECUTITON ***&#039; <BR>&#039;**************************************** **&#039; <BR><BR>Set adocmd = Server.CreateObject("ADODB.Command") <BR>adocmd.CommandText = "sp_test" <BR>adocmd.ActiveConnection = dataConn <BR>adocmd.CommandType = adCmdStoredProc <BR><BR>adocmd.Parameters.Append adocmd.CreateParameter("ID", adInteger, adParamReturnValue, 4) <BR><BR>&#039; THIS IS WHAT I MEAN, DO i HAVE TO REPEAT THIS LINE FOR EVERY SINGEL VALUE I WOULD LIKE TO INSERT? <BR><BR>&#039; say that i want to post the variable test1 to 20 <BR>adocmd.Parameters.Append adocmd.CreateParameter("test", <BR>adVarChar, adParamInput, 50, test) <BR><BR><BR>adocmd.Execute <BR><BR>testID = adocmd.Parameters("ID").Value <BR>test = adocmd.Parameters("test").Value <BR><BR>Response.write testID <BR>Response.write test <BR><BR><BR>Hope you understand my question =D <BR><BR>TNX