Dear all
I want to insert data in two tables and made a sql string with insert statement for each table and want to use UNION to insert data to two tables at a time but I am getting syntax error in INSERT INTO statement. My sql string codes are as below Pl let me know the correct formation of sql statement using UNION for INSERT INTO statement.
Sql = "(INSERT INTO ORDERS (OrderID, CustID, Product, UnitPrice, Quantity, Discount) Values(@OrderID, @CustID, @Product, @UnitPrice, @Quantity, @Discount);) UNION " + _"(INSERT INTO CUSTOMERS (CustID, Company, FirstName, LastName, phone, ) Values(@CustID, @Company, @FirstName, @LastName, @phone, @);)"Sunilsb