Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Nov 05, 2012 12:54 AM by Decker Dong - MSFT
0 Points
6 Posts
Nov 04, 2012 05:35 AM|LINK
I faced problems in transferring data from two tables into another two tables at the same time..
I used LEFT OUTER JOIN to join both tables but there's still have errors..
string UpdateOrder = "INSERT INTO Order LEFT OUTER JOIN OrderDetails ON Order.orderNo = OrderDetails.orderNo (Order.orderDate,Order.totalOrderPrice,Order.membershipNo, OrderDetails.productNo, OrderDetails.productQty, OrderDetails.subTotalOrderPrice, OrderDetails.productColor,OrderDetails.productRemarks)" + "SELECT ShoppingCart.cartDate,ShoppingCart.totalCartPrice,ShoppingCart.membershipNo, CartDetails.productNo, CartDetails.productQty, CartDetails.subTotalOrderPrice, CartDetails.productColor,CartDetails.productRemarks" + "FROM ShoppingCart LEFT OUTER JOIN CartDetails ON ShoppingCart.cartNo = CartDetails.cartNo";
any one can help on this ???
All-Star
31237 Points
6384 Posts
Nov 04, 2012 10:20 AM|LINK
Nov 04, 2012 04:14 PM|LINK
I want to retrieve data from two tables into another two tables.
35986 Points
6550 Posts
Nov 04, 2012 09:12 PM|LINK
sasalyn I faced problems in transferring data from two tables into another two tables at the same time..
Because you cannot insert data into 2 tables in 1 INSERT statement at the same time. You need to execute 2 INSERT statements
118619 Points
18779 Posts
Nov 05, 2012 12:54 AM|LINK
sasalyn I used LEFT OUTER JOIN to join both tables but there's still have errors..
What problem have you got?
Can you elebrate it more?
Exception?
sasalyn
0 Points
6 Posts
Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 05:35 AM|LINK
I faced problems in transferring data from two tables into another two tables at the same time..
I used LEFT OUTER JOIN to join both tables but there's still have errors..
string UpdateOrder = "INSERT INTO Order LEFT OUTER JOIN OrderDetails ON Order.orderNo = OrderDetails.orderNo (Order.orderDate,Order.totalOrderPrice,Order.membershipNo, OrderDetails.productNo, OrderDetails.productQty, OrderDetails.subTotalOrderPrice, OrderDetails.productColor,OrderDetails.productRemarks)" +
"SELECT ShoppingCart.cartDate,ShoppingCart.totalCartPrice,ShoppingCart.membershipNo, CartDetails.productNo, CartDetails.productQty, CartDetails.subTotalOrderPrice, CartDetails.productColor,CartDetails.productRemarks" +
"FROM ShoppingCart LEFT OUTER JOIN CartDetails ON ShoppingCart.cartNo = CartDetails.cartNo";
any one can help on this ???
oned_gk
All-Star
31237 Points
6384 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 10:20 AM|LINK
sasalyn
0 Points
6 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 04:14 PM|LINK
I want to retrieve data from two tables into another two tables.
hans_v
All-Star
35986 Points
6550 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 04, 2012 09:12 PM|LINK
Because you cannot insert data into 2 tables in 1 INSERT statement at the same time. You need to execute 2 INSERT statements
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Transferring data from two tables into another two tables at the same time.
Nov 05, 2012 12:54 AM|LINK
What problem have you got?
Can you elebrate it more?
Exception?