Hi,
I have 2 databases and each of them has different tables. I want to copy all of tables of database A to database B while keeping the existing tables of database B.
What is the best solution?
Thanks
Use Data Import/Export Wizard. Its available under All Tasks when you right
click on the DB.
A problem with this though is that the newly created tables will have dbo as
the owner. If its a critical issue, a workaround is to save the script of
this script as vbs file and edit it manually.
Amol.
"Tom" <kerocow@.yahoo.com> wrote in message
news:28156BCB-6D94-4D1A-90C0-4B28C74CC92D@.microsoft.com...
> Hi,
> I have 2 databases and each of them has different tables. I want to copy
all of tables of database A to database B while keeping the existing tables
of database B.
> What is the best solution?
> Thanks
>
|||On Thu, 22 Apr 2004 06:41:02 -0700, Tom <kerocow@.yahoo.com> wrote:
>Hi,
>I have 2 databases and each of them has different tables. I want to copy all of tables of database A to database B while keeping the existing tables of database B.
>What is the best solution?
>Thanks
>
DTS (Click on Database A choose All Tasks Export), be aware that
indexes don't get copied (by design) if you choose the first choice
"copy Tables and Views", choose third option "copy objects and data"
to copy indexes as well.
Chris
|||Make sure you double check the default options. By Default it will select all data and also will copy all users.
Jeff
MCDBA, MCSE+I
|||On Thu, 22 Apr 2004 09:56:14 -0400, "Amol" <apk@.cbord.com> wrote:
>A problem with this though is that the newly created tables will have dbo as
>the owner.
-- How about running a script such as this to create a
-- script to change the table owner
-- Set Query results in text first
select 'sp_changeobjectowner [dbo.' + name + '],NEW_OWNER'
+ char(13) +'go'
from sysobjects where (uid in (1,3) and type='U')
-- regards
-- Chris
|||Thanks for help.
DTS is easy to use. I selected the 3rd radiobutton "copy objects and data" to copy tables from DB A to B.
If I have the same table name in 5 DB - A, B, C, D, E,
A is the central DB,
the data of those tables in B to E will be copied to A's table daily,
can the index be auto-generated and appended to A's table?
e.g. The index in DB A's table are
1
2
3
4
5
I add 4 rows of DB B's table data to A.
Will the index in DB A's table like:
1
2
3
4
5
6
7
8
9
where 6-9 come from DB B.
I saw that there is an overwrite or append data options in DTS. Do I just choose 'Append' and it will do that?
If I set the schedule, can it be done daily?
Thanks for advice.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment