View: 3751|Reply: 6
|
Data transfer from one database to another database
[Copy link]
|
|
Data transfer from one database to another database
Hi all,
i want to transfer data one sql database to another database in same sql server . i used php programming. i try to insert into table2 select * from table1 , but this query useful for same database, but i want to use different database, in same sql server.
help me here to solve this problem,
|
|
|
|
|
|
|
|
sekadar idea... sbb dlm .net kan...
a] kalo in programming > dalam function ada
- store dulu data yg nk di transfer dalam "dataset"
- kemudian read(dataset) dan for each row dalam dataset > insert into table yang kita nk letak
b] kalo guna SQL statement
- boleh guna ini.. tp x sure dlm syntax mySQL
" insert into destinationDB..destinationtable
select * from sourcedb..sourcetable "
di harap boleh membantu sikit2..
|
|
|
|
|
|
|
|
just sharing..
problem: nak transfer data dari satu database ke satu database (jenis yg sama atau jenis lain2) yg lain (dalam satu server yg sama)
my suggestion:
1. kalau guna programming - cth PHP:
- buat 2 connection (mysql_dbconnect), satu connection ke db1 (cth mysql - source) dan satu connection ke db2 (MS-SQLserver target)
- lepas tu mcm biasa la.. create table.. then insert satu data
2. kalaau guna tools/front end (e.g. phpmyadmin etc)
- export data dlm database tu dlm standard SQl format (dump file)
- lepas tu import balik file tu dlm database yg dikehendaki
senang kan?
|
|
|
|
|
|
|
|
err kalo pki exchange server x bleh ka? aku x brp terer sgt bab2 database ni just bg idea bodo jah... |
|
|
|
|
|
|
|
Salam bro... soalan x lengkap..
Pakai language apa nie? C# atau VB? |
|
|
|
|
|
|
|
same server? same dbms? same instance?
mintak database admin grant full access ke database satu lagi. pastu buat insert statement camni :-
insert into targetDatabase.dbo.table1
select * from sourceDatabase.table1 |
|
|
|
|
|
|
|
chuki2 posted on 12-11-2012 10:40 PM
Salam bro... soalan x lengkap..
Pakai language apa nie? C# atau VB?
pakai php
|
|
|
|
|
|
|
| |
|