Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 How to insert data into a table from another table and from variables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-23 : 13:03:37
Bruce Randolph writes "I am trying to store order data in a permanent table (orderdetail) from a shopping cart table. The orderdetail table also contains the order number, which is repeated on each line, where needed, and a line number which starts over at 1 with each new order, and 6 other fields. The order number is a variable set earlier. The shopping cart table contains data other than the 6 items I really need.

We have been doing this in ASP using recordsets and are trying to convert it all to SQL for efficiency.

So I need to develop the code to insert the ordernumber, the linenumber(which also has to be calculated elsewhere - not sure how to do that AND get the results inserted here), plus 6 pieces of data per line from the shopping cart table.

The two tables have no common elements for identities or to perform joins with.

Using Windows NT 4.0, service pack 6a and SQL Server 7.0.

Thanks!!!"
   

- Advertisement -