You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INSERT INTO Sales.MyOrders(custid, empid, orderdate, shipcountry, freight)
VALUES
(2, 11, '20170620', N'USA', 50.00),
(5, 13, '20170620', N'USA', 40.00),
(7, 17, '20170620', N'USA', 45.00);
--Insert com Select
INSERT INTO Sales.MyOrders (custid, empid, orderdate, shipcountry, freight)
SELECT CustomerID, SalesPersonID, orderdate, N'USA', freight FROM Sales.SAlesOrderHeader WHERE SalesPersonID is not NULL
--Select com Insert
DROP TABLE IF EXISTS Sales.MyOrders;
SELECT CustomerID, SalesPersonID, orderdate, N'USA' as shipcountry, freight INTO Sales.MyOrders FROM Sales.SAlesOrderHeader WHERE SalesPersonID is not NULL