Link to home
Start Free TrialLog in
Avatar of aneilg
aneilgFlag for United Kingdom of Great Britain and Northern Ireland

asked on

SQL Import Wizard

I want to import tables from one row to another but i want to overwire the existing table with the new table, but it looks like the wizard only appends to the existing table.

Is there any way to drop the table first then inport the tables.
Avatar of RiteshShah
RiteshShah
Flag of India image

do you want to import from one server to another or in same server one database to another?

You can do something like this:

drop table db1.table1
GO

select * into db1.table1 from db2.table1

it will create table1 in db1 and import all records from table1 of db2 to db1.table1
Avatar of aneilg

ASKER


Its from the same server but a different database, the problem is there are over 60 tables, just thought there might be a way around it.
ASKER CERTIFIED SOLUTION
Avatar of Reza Rad
Reza Rad
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of geek_vj
geek_vj

Agree with reza_rad on this...You can select the option of 'Drop and Recreate destination table' if you want to have a fresh table.
Ritesh answer will have the problem if there is some relationship then drop will affect, but what reza has given will solve the problem for what ur looking for.
Avatar of aneilg

ASKER

Thanks for your help once again guys.

reza was spot on, i am not bothered about the relationships, so thanks for pointing that out.

thanks.