Tuesday, March 25, 2014

Create a table in SQL Server, Export tables from Microsoft Excel to Microsoft SQL Server, Populate the created table

Hello Naomi,


I have imported all the tables into SQL Server,


I created a table:


CREATETABLE dbo.Orders


.......................................


...........................................


.............................................



Now I want to populate this table with the values from imported tables, will this code take care of this task?


INSERT INTO dbo.Orders(OrderId, OrderDate)


SELECT OrderId, OrderDate


FROM Sales.Orders


UNION

SELECT OrderId, OrderDate


FROM Sales.Orders1


Union


SELECT OrderId, OrderDate


FROM Sales.Orders2


If not, what is the code?


Please advise me.


GGGGGNNNNN




GGGGGNNNNN


No comments:

Post a Comment