Anti-Rich
Well-known member
hi all,
i was just wondering how it is possible to move data from one table in a database to another table in another database. i am migrating my data from the original db as i have integrated the original db (as well as the application that uses it) into a larger db (and application) i am currently working on. this table only has about 6k rows.
this is what i have for the query so far:
as you can see, the second part is where i get stumped. i thought using dbo.twdbs.tblWTBackups would work... obviously i am missing something. if i can get some input from someone that would be great
cheers
adam
i was just wondering how it is possible to move data from one table in a database to another table in another database. i am migrating my data from the original db as i have integrated the original db (as well as the application that uses it) into a larger db (and application) i am currently working on. this table only has about 6k rows.
this is what i have for the query so far:
VB.NET:
[SIZE=2][COLOR=#0000ff]use[/COLOR][/SIZE][SIZE=2] twdbs[/SIZE]
[SIZE=2][COLOR=#0000ff]create [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]table[/COLOR][/SIZE][SIZE=2] tblWTBackups[/SIZE]
[SIZE=2][COLOR=#808080]([/COLOR][/SIZE]
[SIZE=2]wDate [/SIZE][SIZE=2][COLOR=#0000ff]varchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]50[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]VoucherNo [/SIZE][SIZE=2][COLOR=#0000ff]nvarchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]50[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]itemCode [/SIZE][SIZE=2][COLOR=#0000ff]nvarchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]50[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]Company [/SIZE][SIZE=2][COLOR=#0000ff]nvarchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]50[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]PickedUp [/SIZE][SIZE=2][COLOR=#0000ff]nvarchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]50[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]TimeIn [/SIZE][SIZE=2][COLOR=#0000ff]nchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]10[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]TimeOut [/SIZE][SIZE=2][COLOR=#0000ff]nchar[/COLOR][/SIZE][SIZE=2][COLOR=#808080]([/COLOR][/SIZE][SIZE=2]10[/SIZE][SIZE=2][COLOR=#808080]),[/COLOR][/SIZE]
[SIZE=2]Qty [/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][SIZE=2][COLOR=#808080],[/COLOR][/SIZE]
[SIZE=2]QtyPacks [/SIZE][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080])[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]insert [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]into[/COLOR][/SIZE][SIZE=2] [tblWTBackups][/SIZE]
[SIZE=2][COLOR=#0000ff]select [/COLOR][/SIZE][SIZE=2][COLOR=#808080]* [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]from[/COLOR][/SIZE][SIZE=2] tblWT[/SIZE]
[SIZE=2][COLOR=#008000]--now, i shall hopefully grab all data from tblWTBackup and put it into the tblWT table on [/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]--tvms[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]use[/COLOR][/SIZE][SIZE=2] tvms[/SIZE]
[SIZE=2][COLOR=#0000ff]insert [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]into[/COLOR][/SIZE][SIZE=2] tblWT[/SIZE]
[SIZE=2][COLOR=#0000ff]select [/COLOR][/SIZE][SIZE=2][COLOR=#808080]* [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]from[/COLOR][/SIZE][SIZE=2] c04438[/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2][TWDBS][/SIZE][SIZE=2][COLOR=#808080].[/COLOR][/SIZE][SIZE=2][tblWTBackups][/SIZE]
as you can see, the second part is where i get stumped. i thought using dbo.twdbs.tblWTBackups would work... obviously i am missing something. if i can get some input from someone that would be great
cheers
adam
Last edited: