Hi, <BR>I am using the below code to update my records in database using asp.<BR>I want to make it as a stored procedure and run as batch file everyday. I tried couple of ways using stored procedure but it is not accepting i am new to stored procedures. Can any one help me to write a stored procedure for the following code in sql server 7.<BR><BR><BR><BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR><BR>sql = "SELECT Appl_ref_num, Fee_rec_num, applrefnum, invoice_date, invoice_num FROM table1, onereport WHERE table1.Appl_ref_num = onereport.applrefnum and Table1.Fee_rec_num is null "<BR><BR>rs.Open sql, cn<BR><BR>do until rs.eof<BR> Applnumber = trim(rs("ApplrefNum"))<BR> feerecnum = trim(rs("invoice_num"))<BR> ReceivedDate = trim(rs("invoice_date"))<BR><BR> <BR> Set objData = CreateObject("ADODB.Connection")<BR> objData.Open cn<BR> <BR> strSQL = "UPDATE Table1 SET fee_rec_num = &#039;" & feerecnum & "&#039;, fee_rec_date = &#039;" & ReceivedDate & "&#039; where Appl_ref_num = &#039;" & Applnumber & "&#039; " <BR><BR> Response.Write strSQL & "<BR>"<BR> objData.Execute strSQL<BR> <BR>rs.movenext<BR>loop<BR>Thanks