> I need help in writing a stored procedure on SQL Server
> 2000. Basically the stored procedure's primary task is to
> generate invoice records and insert the records in a
> invoice table. In order to generate the invoice records,
> I have an initial table which are basically Day Records.
> The task that I would like to complete is to select all
> records from that initial table and I guess put them into
> a temp table. Now that i have my temp table, I would like
> to loop thru the table record by record, and do inserts
> in the invoice table. I cant seem to figure out the
> syntax since I am somewhat weak in TSQL Programming. I
> would appreciate any assistance on this forum or to my
> email. Also If you need some pseudocode for the process
> or the DDL for the initial table and the invoice table, I
> can definitely post that in the forum possibly in the
> next thread. Please advise, I would need a full written
> syntax to get me started since i have some other
> processes that I would need to build using the template.
> Thanks again.
> >-----Original Message-----
> >You can use Cursors (see books online)
> >Use WHILE .. BEGIN .. END (see books online)
> >"Mansoor Aleem" <aleemmansoorhotmail.com> wrote in
> >> How can I select some records and then loop thru them
> >> by one and then insert a new record in another table.
> >> This is all within a sp. Thanks.