views:

44

answers:

1

hi All,

I am doing data migration two database in MS SQL 2005. The records are more than 200000 nearly 300000. I need to query from source database using joins and insert 2 or 3 tables in destination databse.

Which way is the best way to do so? Please suggest me. I am trying to write a program with VB.NET. If you have sample, please show me the way how to.

Thanks in advance, RedsDevils

+1  A: 

Is the issue with the source data well defined? If so, then you can just use Linked Servers, and query from one database and insert into the target filtering out the bad data using your select query. This would remove the need to write anything in .NET...

davisoa
Ok I will try this!
RedsDevils
Linked Servers is for Different Server? How can I access different Databases in Same Server?
RedsDevils
You can do that by ensuring you have access to both databases on your current connection, and then prefix the table names with the names of the databases you need. i.e. INSERT INTO Database2.dbo.Table1 (fieldnames) SELECT * FROM Database1.dbo.Table1
davisoa