firstly i am new to Programming and SQL (7 Months) and this is the first time i have done this. i am self taught for the most part.
here it goes,
I have an Excel spreadsheet with all the data in it, all the column names correspond with the names in the database. i used the wizard and successfully managed to import the data. HOWEVER rather than insert the data into the target tables as i wanted the stupid thing (which doesn't let you amend the destination btw) created new tables (exactly the same as the tables i had created except with a $ at the end) and inserted everything there!
I've tried a few things and this is the best and as close as I can get so my question is
How the hell do I now transfer ALL the records from the created tables into where I need them?
we are talking about 4 tables (in a 7 table DB) and hundreds of inserts in two of the tables and over 2,000 in the other two.
the proper tables are
dbo.Crystal
dbo.Essential
dbo.MineOp
dbo.Origin
the falsely created tables are dbo.Crystal$ dbo.Essential$ dbo.MineOp$ dbo.Origin$
all the columns and values etc are the same they are in fact identical copies of each other but i need the $ ones into the original ones (that have keys and constraints) and then ill delete the false tables.
Can I do these in Bulk?? if so someone PLEASE give me the EXACT Script syntax i need to do this, as i have no idea. i know my basic commands and insert statements, don't know what let alone how a JOIN or MERGE/R is? let alone how to do it
I am using Microsoft SQL Server Management Studio 2012 (Express)
INSERT INTO [JDatabase].[dbo].[MineOp] (Name)
SELECT Name
FROM [JDatabase].[dbo].[MineOp$];
and the same for the other tables just with the other table details! thanks for the negative vote!