简体   繁体   中英

LLBLGen: Copy table from one database to another

I have two databases (SQL Server 2005) with the same table schemes. I need to copy data from source table to destination with some modification of data along the way.

And if destination table already contains some data, then rows from source table should not override, but be added to the destination table.

In our project we use LLBLGen and LINQ to LLBLGen to as ORM solution.

Example:
    Database 1        Database 2                   Database 1
    Table 1:          Table 1:                     Table 1:
    Key Value         Key Value                    Key Value
    1   One           1   T2_One       Result=>    1   One
    2   Two           2   T2_Two                   2   Two
    3   Three                                      3   Three
                                                   4   T2_One
                                                   5   T2_Two

我将在DB1中创建表2的视图(您可以从另一个DB中创建表的视图),使用LLBL GetPro生成代码,并进行查询以从视图中选择表1中不存在的值。您可以将这些检索到的值保存在表1中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM