Refreshed Data from production Database

Hi,
I have a remote production database.I want to refresh my development database.
Only new inserted data should be refreshed after a certain time period not all
data.
Thanks.
Pankaj Gupta

Another strand of thought occurs:
By "development database" do you mean a database actually used by developers? If so, I think this is a misguided idea, because
(1) production volumes are usually not appropriate for development purposes (load testing ought to be a separate instance)
(2) production data is unlikely to have the necessary breadth and depth of cases necesaary to run proper unit tests.
(3) you don't say what your business is, but there are likely to be security/privacy/accountability issues with making real data available to developers.
Cheers, APC

Similar Messages

  • Transfer data from one database to another

    Hello,
    We have an application which uses an Oracle 9i server database. On this server we have two databases ( one for test and one for production ).
    From time to time it's required to transfer data from production database to test database.
    The steps followed by the ones which made the transfer are:
    a) drop the user schema ( the one which contains all data)
    b) recreate the user
    c) import the data ( using import utility )
    d) compile invalid object ( what this will mean I don't know)
    It's not possible to delete only the content of the tables and then import data from a dump file? In this way the steps c) and d) will no longer be required. If this is possible can you tell me if is there a command which will delete all data from all table ( almost 2000 tables)?
    Thank you fro your help!

    I think ..following a,b,c,d is the best way to maintain consistency. you are just thinking about the data in the tables, but what about the changes in views,procedures,functions etc....
    compile invalid object ( what this will mean I don't know)create a file xxx.sql with following code and execute it from sql*plus
    set echo off
    set head off
    set feedback off
    set timing off
    spool compile_invalid_obj.sql
    select 'ALTER '||DECODE(OBJECT_TYPE,'PACKAGE BODY','PACKAGE',OBJECT_TYPE)||' '||OBJECT_NAME||' '||DECODE(OBJECT_TYPE,'PACKAGE','COMPILE PACKAGE;','PACKAGE BODY','COMPILE PACKAGE;','COMPILE;')
    from user_objects
    where status = 'INVALID';
    spool off
    set feedback on
    set echo on
    set timing on
    @compile_invalid_obj.sql
    HTH
    --Chaitanya                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Ora-00600 while Refreshing data from Source DB

    Hi Folks,
    Actually i have an ODS system on Target database which has Mappings to source DB. Both DBs are 10.1.0.4.
    Most of the refreshes are susccuful excpet for one large mapping.
    I got this in the Source DB alert.log :
    ## Mon Jun 16 12:21:38 2008
    ## Errors in file /oracle/admin/PPRD/bdump/pprd_mmon_1911.trc:
    ## ORA-00600: internal error code, arguments: [ktte_verify_tsth], [], [], [], [], [], [], ## []
    ## Mon Jun 16 12:21:42 2008
    ## Restarting dead background process MMON
    ## MMON started with pid=45, OS id=17487
    ## Mon Jun 16 12:21:45 2008
    ## Errors in file /oracle/admin/PPRD/bdump/pprd_mmon_17487.trc:
    ## ORA-00600: internal error code, arguments: [ktte_verify_tsth], [], [], [], [], [], [], ## []
    When i logged an SR with Oracle, they didn't help me because the DB is no longer supported ( 10.1.0.4 ) !
    The metalink has some bugs that hit this issue but the problem that this used to work fine.
    My servers are on Solaris Sparc 64-bit
    Please advise Gurus,
    Cheers,
    Feras

    Hi,
    We have a BANNER system which uses a cross product called ODS ( Operational Data Storage ) . ODS is a datawarehouse DB and we run ETL Jobs to refresh data from source DB to ODS database. Jobs which contains PL/SQL insert/update/delete code. When we run one of the heavy refresh processes, we face the issue above.
    Please Advise,
    Cheers,
    Feras

  • How to move only subset of data from one database to another?

    Both source & destination are Oracle11g databases.
    The requirement details are as below,
    1) The database contains static as well as transactional data for telecom domain.
    2) We have to move region-wise data from one database to another.
    3) There are around 10 regions.
    4) The region wise data extraction from source db is based on around 40 to 50 tables. Rest of the tables contains
    static data & it will not change.
    5) The volume is around 1 million subscribers per region.
    6) The migration is required because
    a) The client is upgrading its base product which uses this database
    b) There is a change in structure of static tables
    c) Hardware upgrade
    d) The client want to start with single region on new database & rest of the regions will be operated from old
    database.
    7) Keep execution time to very minimum.
    I am thinking to have solution as below,
    1) Create destination database with upgraded db structure (as mentioned in 6b)
    2) Create database links to access source db in destination db.
    3) Write SQL queries to fetch data from all the respective tables for a specific region
    4) Write separate PL/SQL blocks for each table to fetch data from source db & insert into respective table in
    destination db
    a) Use FOR ALL & bulk collect to improve the performance
    b) Divide table data into multiple chunks & execute parallel batches (around 10) to insert the data
    5) Validate pre & post counts to verify the success of migration
    Is there any other better way?
    Regards,
    Sandeep

    How to move only subset of data from a partiular table by using transportable tablespace?
    E.g. SUB table using SMP_SUB tablespace contains subscriber data in source database.
    The indexes defined on SUB table are under SMP_IDX_SUB tablespace
    The subscribers data can be categorized by different regions, say region_id column. Then how to move data & indexes of SUB table from source db to destination db?
    any specific example would be helpful.

  • Exporting data from Production to Development in a R/3 System

    Good Morning,
    I have a landscape where i have a Productive and a Development system (SAP R/3 Enterprise Release 4.70 SR1 1.10 with MaxDB 7.5 running on a HP-UX 11.23) and i was asked to copy the data and customizing (not user master data) from Production to Development. Both systems have 7 clients (6 for each country and one for Human Resources) and i need to copy the productive data to the development data (the Productive data can overwrite the Development data).
    This is my first time doing this, and since i have a short deadline to do it, i need all the help i can get...
    I'm not sure if i should use SCC8 or SCC9 in order to create a transport request for each client copy.
    I've checked the OS space in sapdata and transport directories, i've also checked the database space and i need to change MAXDATAVOLUMES size and also create more volumes.
    Now that i've done that, i need to know what to do next... Does anyone knows where i can find a procedure or documentation on this? Some kind of step by step guide?
    About the Export Profiles, which default profile should i choose in order to copy
    All client specific data, customizing AND NOT user master data?
    Can i do any kind of test run before the export in order to understand the space i'm going to need in transport directory for example?
    Thanks in advance.
    Best Regards,
    Pedro Gaspar

    Hello Pedro,
    1. In SCC8 the SAP_APPL profile isn't available, so i guess i need to use SAP_ALL and change the user master data accordingly afterwards right?
    In that case, you should/can 'Export' the user master of the target system before the Client copy, so that you can re-import the same user master in the target system after sap_all copy from source.
    2. I also have several project teams developing in ABAP in my development system. If i export the productive client, will the ABAP code be overwritten (scripts, smartforms, etc...)? I ask this, because right now there are several programs with different versions in both systems (the landscape consists of only a DEV and PRD system NO quality). If the ABAP code in development will be overwritten, i need to tell the development teams to comment all the changes, then create transports to production to make the program versions the same, and then save the data an cofiles to import them again in development after the import. Will also RFC definitions change? Jobs will also be copied? What's the difference between this and a Homogeneous System Copy using backup/restore?
    This is the reason that normally the 'Production to Development' copy is not recommended. I would wait if our other techies here can help/advise us for this.
    A simple difference between a client copy and system copy is that the client copy is just 'client dependent' change and system copy is 'system wide' change - erasing everything on the target and just overwriting/duplicating the 'complete source' onto the target.
    Thanks

  • Upload data from Access Database to Oracle Database In oracle 8i

    hi everybody
    i am trying upload data from Access database to Oracle Database
    i have TT(F1,F2,F3) table in Access Databsse
    and emp(ename,ecode,sal) in oracle Database
    db_ac is my datasource name
    when i connect to Access Database thru this command this show following error
    SQL> connect a/a@odbc:db_ac;
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    ORA-00022: invalid session id; access denied
    Error accessing PRODUCT_USER_PROFILE
    Warning: Product user profile information not loaded!
    You may need to run PUPBLD.SQL as SYSTEM
    Server not available or version too low for this feature
    ORA-00022: invalid session id; access denied
    Connected.
    when i am trying copy data as this command it show error and data not copied.
    SQL> COPY FROM A/A@ODBC:DB_AC TO test/test@ora INSERT EMP USING SELECT F1,F2,F3 FROM TT;
    Array fetch/bind size is 15. (arraysize is 15)
    Will commit when done. (copycommit is 0)
    Maximum long size is 80. (long is 80)
    ORA-00022: invalid session id; access denied
    ERROR:
    OCA-00022: general OCA error
    can help me .
    with thanx

    Hi there,<br>
    <br>
    Please kindly use instead the Database Forum at:-<br>
    General Database Discussions<br>
    <br>
    ... to place your question as this is for the Oracle Portal product Export / Import functionality.<br>
    <br>
    <br>
    Kind regards,<br>
    Pedro.

  • Failed to retrieve data from the database Database Vendor Code: 2812

    Hi everyone
    Im using Sap Business One Version 2007A SP00 PL49, SQL 2005 and Crystal Reports Basic for Sap Business One (Add on 2.0.0.7). Whenever i try to generate a report from SBO the system displays the following message "Failed to retrieve data from the database DETAILS: [Database Vendor Code: 2812]"
    The scenario is that, according to the Colombia's product local expert, Is not possible to create Stored Procedures, Views, Functions or anything in the customer productive database, in order to improve the performance of the query i created other DB where i created an stored procedure, after that, i called it from Crystal where it's working ok. But when i try to generate it from SBO it show the message promted.
    Someone knows what could be happening
    I'll be thankful

    Hi Cesar,
    Please post your question to the Business One forum.
    I can't move this thread.
    Thank you
    Don

  • Crstal Reports: "Failed to retrieve data from the database"

    Running a report in crystal report from SAP 8.81 using the following parameters: CardCode, GroupCode, Date gives the following error: "Failed to retrieve data from the database" "Conversion failed when to converting the nvarchar value to data type int 12/31/2005 [Database vendor code: 245] ".
    The store procedure in SQL Server executes smoothly and  If you run the report with the date = 12/31/2005 in the parameter also returns expected results.
    Thanks.

    Hello,
    Is this in Business One? If so CR is an OEM build and that forum/product supports that version.
    Please post your question to: http://forums.sdn.sap.com/index.jspa#44
    It could simply be you need to use a formula to convert the field. Click on the Formula Editor and the hit the F1 key and search on "date". Lots of info on how to convert todate and from date tostring...
    Thank you
    Don

  • Dynamic parameter - Failed to retrieve data from the database

    I'm running  a report with dynamic parameters and this report ran successfully for 2 days . For no apparent reason they stopped and the error message was received.  There was no interference from head office soI'm at a loss to explain why the viewer / reports suddenly stopped working.
    Now  I get the following message:
    Prompting failed with the following error message:
    'List of values failure: fail to get values. Cause of error: Failed to retrieve data from the database. Error in file UNKNOWN.RPT: Failed to retrieve data from the database.'
    Error source: prompt.dll Error code: 0x8004380D
    The report is running on a Oracle database using CR-Viewer XI Product version 12.01.1.r228_v20071114
    I know there is a problem with dynamic parameters and citrix, but this is not run on citrix.
    Please help anypne
    Edited by: tstegen on Sep 30, 2009 2:48 PM

    Is this report based or Enterprise based LOV?
    If you have report published to BOEnterprise, then it automatically creates a chain of objects for any dynamic parameter:
    Data Connection,
    Data Foundation,
    Business View,
    Business Element
    and LOV.
    Each of this objects have configurations like users rights, permissions and some have logon configuration. Failing any of those elements may cause LOV to fail.
    One of the tests you may try is to test relevant Business View by connecting Crystal reports to it.
    Are you familiar with Business View Manager?

  • Failed to retrieve data from the database (Apache derby). Details: java.lang.reflect.InvacationTargetException

    Post Author: johnnighter
    CA Forum: Data Connectivity and SQL
    Hi,Good Day !I followed crxi_java_bean_data_source.pdf to setup and configure Crystal Report XI (Product Version 11.0.0.1282, CR Developer; Product Type: Full).Below is the sample code.import java.sql.*;public class CRSampleDataSourceBean {    private ResultSet resultSet = null;    private Connection connection = null;     private String connectionURL = "jdbc:derby:MyDatabase";    private String databaseClass = "org.apache.derby.jdbc.EmbeddedDriver";    private String query = "SELECT * FROM CUSTOMER";         public CRSampleDataSourceBean()     {        try         {                        Class.forName(databaseClass);                        connection = DriverManager.getConnection(connectionURL, "", "");        }         catch (ClassNotFoundException ex)         {            System.out.println("Ensure that database driver class is installed.");            ex.printStackTrace();        }         catch (SQLException ex)         {            System.out.println("SQL Exception #" + ex.getErrorCode() + " : " + ex.getLocalizedMessage());            ex.printStackTrace();        }    }            public ResultSet getResultSet() throws SQLException     {                Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);                resultSet = statement.executeQuery(query);        return resultSet;    }}Compile no error. It display at the "Java Beans Connectivity" screen, and able to select from the "Java Bean Classes" combobox.It display at the "Available Data Sources" (left hand side) with database name CRSampleDataSourceBean->getResultSet.  BUT when click the ">" or ">>" button, it display an error message "Failed to retrieve data from the database. Details: java.lang.reflect.InvacationTargetException". Please advice. regards,johnnighter    

    Post Author: pvierheilig
    CA Forum: Crystal Reports
    Have you been able to resolve this yet?  I don't have any reference to Oracle error codes but would suspect a quick Google of something like 'Oracle error code 997' should result in good information, since it is an Oracle error...
    Hope this helps.

  • Failure to retrieve data from the database (Vendor Code 6550)

    I am having a trouble with two of the 6 reports that I have created. I am using Crystal XI and Oracle 10g. The underlying database object is a stored procedure that accepts as input a start time as a TIMESTAMP, an end time as a TIMESTAMP and a furnace number as a number. I have a cursor ref as a return parameter.
    When I run the stored procedure in Oracle I get the selected records and can view them on the screen.
    When I refresh data on the report in Crystal XI developer, the designer asks me for the start and end time and furnace number. When I input these values the report displays properly.
    When I launch the report from my VB .NET 2005 application I am asked for the username and the password for the database (this is another problem I need to solve as this information I put into the program seems to be ignored in my program) then I receive the following failure message:
    Failure to retrieve data from the database (Vendor Code 6550)
    When I launch the other reports, they only ask me for the username and password then they display the proper data.
    The main difference between my other reports and the two that are returning the above failure code is that the other reports are to either tables or views. The two that don't work are tied to stored procedures. I there any way that I can solve this problem or at least get more information?
    Any help would be greatly appreciated. Let me know if you need any other information.

    I have a similar problem, the only difference is that the crystal report error is only thrown when I try to load the sub reports at my web application. When I deploy my report to the Web application the main report loads up fine but when I try to launch the sub reports from the main report it can no longer load.
    But when I use the Crystal report developer I am able to load the main report and it's associated sub reports without any issues.
    My issue only occurs when I try to load the sub report in the web application. The following sections shows how my reports look like both in my .NET web application and also at the Crystal Report Development IDE.
    Failure: Loading my Reports from .NET Web Application
    1) When I load from the web application I am able to load the main report as per the print screen below.
    2) When I try to click on the hyper links to enter the sub reports I am now able to load them, both sub reports cannot load and will throw the same error "
    Failed to retrieve data from the database. Details: [Database Vendor Code:
    6550 ] Failed to retrieve data from the database. Details: [Database Vendor
    Code: 6550 ] Failed to retrieve data from the database. Error in File OAWR3011A
    {CEC8A94A-4490-4640-95FB-2739A679978B}.rpt: Failed to retrieve data from the
    database. Details: [Database Vendor Code: 6550 ] "
    Success: Loading my Reports from Crystal Report Development Tool
    1) This is my Main Report Loaded from the Crystal Report Development Tool, the first two hyperlinked fields are links to my sub reports, step number 2 and number 3 shows my sub reports when I load it using Crystal Report Developer
    2) Sub Report 1 Loaded Successfully, when I click on the fields in the first link
    3) Sub Report 2 loaded successfully when I click the second field hyper link

  • Question - Comparing data from 2 databases

    I'm new to Oracle - I'm trying to compare data from 2 separate databases.
    I'm trying to get data from both databases based on a common TRACKING_NUMBER. The issue is that in one database there are additional 0s in front of the Tracking_Number.
    So I'm trying to find out what I can put in my query to remove those zero's in front of the tracking number. I have the query below - it's very long.
    SELECT DISTINCT cm.TRACKING_NUMBER_TYPE AS HType,
    TRUNC(cm.CREATED_DATE) as CodeMoveDate,
    SUBSTR(cm.CODE_MOVE_DESC, 1, 50) AS Description,
    cm.TRACKING_NUMBER AS TrackingNumber,
    rq.Plant_Name as Location,
    jr_eur.Assignee as Tracker,
    TRUNC(MAX(jr_spec.Journal_Date)) as Date_Spec,
    TRUNC(MAX(jr_app.Journal_Date)) as Date_Approved,
    TRUNC(MAX(jr_ut.Journal_Date)) as Date_Unit,
    TRUNC(MAX(jr_qa.Journal_Date)) as Date_Assurance,
    TRUNC(MAX(jr_eur.Journal_Date)) as Date_Enduser,
    TRUNC(MAX(jr_gv.Journal_Date)) as Date_Gatekeeper,
    TRUNC(MAX(jr_prod.Journal_Date)) as Date_Move,
    TRUNC(MAX(jr_eun.Journal_Date)) as Date_Notification,
    TRUNC(MAX(jr_pver.Journal_Date)) as Date_Production,
    TRUNC(MAX(jr_udoc.Journal_Date)) as Date_Documentation
    FROM PROJMAN.PM_CODE_MOVES_V cm,
    PROJMAN.PM_Requests_V rq,
    PROJMAN.PM_Journals_V jr_spec,
    PROJMAN.PM_Journals_V jr_app,
    PROJMAN.PM_Journals_V jr_ut,
    PROJMAN.PM_Journals_V jr_qa,
    PROJMAN.PM_Journals_V jr_eur,
    PROJMAN.PM_Journals_V jr_gv,
    PROJMAN.PM_Journals_V jr_prod,
    PROJMAN.PM_Journals_V jr_eun,
    PROJMAN.PM_Journals_V jr_pver,
    PROJMAN.PM_Journals_V jr_udoc
    WHERE cm.TRACKING_NUMBER = LTRIM(rq.Request_ID(+))
    AND cm.TRACKING_NUMBER = jr_spec.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_app.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_ut.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_qa.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_eur.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_gv.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_prod.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_eun.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_pver.Request_ID(+)
    AND cm.TRACKING_NUMBER = jr_udoc.Request_ID(+)
    AND jr_spec.Journal_Status(+) = 'Spec Doc'
    AND jr_app.Journal_Status(+) = 'Approved'
    AND jr_ut.Journal_Status(+) = 'Unit Test'
    AND jr_qa.Journal_Status(+) = 'Quality Assurance'
    AND jr_eur.Journal_Status(+) = 'End User Review'
    AND jr_gv.Journal_Status(+) = 'Gatekeeper Verificat'
    AND jr_prod.Journal_Status(+) = 'Move to Production'
    AND jr_eun.Journal_Status(+) = 'End User Notificatio'
    AND jr_pver.Journal_Status(+) = 'Production Verificat'
    AND jr_udoc.Journal_Status(+) = 'User Documentation'
    AND cm.TRACKING_NUMBER_TYPE = 'H'
    and cm.CREATED_DATE >{d '2006-12-31'}
    GROUP BY
    cm.TRACKING_NUMBER_TYPE,
    TRUNC(cm.CREATED_DATE),
    cm.CODE_MOVE_DESC,
    cm.TRACKING_NUMBER,
    rq.Plant_Name,
    jr_eur.Assignee
    ORDER BY TRUNC(cm.CREATED_DATE)

    I recommend using a product.
    I used to write scripts and procedures, but no more!
    Reason is: you save time. A lot of time. You pay few hunderes $ once for the product.
    If you do it yourself, you waste half-days doing it properly.
    A good tool for database compare is Comparenicus (www.compareniucs.com).
    I'm using it for 6 months now and it saves me a lot of time.

  • How to Copy complete structure of a table with data from one database table to another databse table

    I need a sql query to copy structure of table with data from production table of ONLINEBTREKDB database to production table of Archive database.
    I tried this query
    select * into Archive.dbo.Production from ONLINEBTREKDB.dbo.Production p
    but problem is I am able to copy the table schema and data but not able to copy constraints(PK)
    Any Help?
    seema

    You've multiple options
    1. Use generate scripts wizard available in SQL management studio. This is particularly helpful when you want to script out lot of objects. You can also choose to script data as well inside this. This can be launched by right clicking the db, choosing tasks
    -> generate scripts and then selecting required options inside the wizard
    2. Use object explorer and right click and script out table. You can also use search functionality to find object you want inside object explorer
    http://visakhm.blogspot.in/2013/02/object-filtering-using-ssms-object.html
    3. Use query based on INFORMATION_SCHEMA views like TABLES,COLUMNS,CONSTRAINT_COLUMN_USAGE etc to generate the script
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Arabic data from Sybase database fails to display correctly in Crystal Reports XI

    Post Author: shajad
    CA Forum: Crystal Reports
    In Crystal Reports XI, reports created with a ODBC (SQL server) connection to a Sybase data source fails to show Arabic data correctly. Arabic data is stored in Sybase under character set Windows-1256, but fails to display as Arabic in Crystal Reports 10. Some junk values like 'ÕæÑÉÇáÓÌá ÇáÊÌÇÑí ÓÇÑíÉÇáãÝÚæá'  appears in the report.
    How can I resolve this issue? Please help me with a solution.

    Hi Raju
    Please let us know the following information:
    - Exact version of Crystal Reports.
    - The type and the version of the database.
    - Connection i.e. ODBC, OLEDB or Native used to connect your database with Crystal Reports.
    - Are you able to create and refresh newly created report using the same database?
    - If you are using ODBC connection, please download the SQLCON32 test utility and try to fetch the data from the database using the query from the "Show SQL" from Crystal Reports and let us know the outcome.
    Hope this helps!
    Thanks

  • Transfer data from one database to another without identities but keep the relation b/w PK and Foreign key

    Hi,
    I need to transfer data from one database to another database (both are identical databases). 
    1. Not transferring identity columns (primary keys). the destination table might have the same key.
    2. keep the PK's and FK's relation b/w parent and child table
    3. I have 4 levels 
    Example: tableA (col1 int identity(1,1) , col2, col3)
    tableB (col1 int identity(1,1) ,
    col2 , col3) -- col2 has the foreign key relation with tableA.col1
    tableC (col1 int identity(1,1) ,
    col2, col3) -- col2  has the foreign key relation with tableB.col1
    tableD (col1 int identity(1,1) , col2, col3) -- col2  has the foreign key relation with tableC.col1
    please advise me.
    Thanks in advance

    Try the below:
    /********************************SAMPLE TARGET***************************************************************/
    Use MSDNSamples
    create table TableA(LevelValueId int identity(1,1) primary key, name varchar(100))
    Insert into TableA(name) Select 'R1'
    Insert into TableA(name) Select 'R2'
    create Table TableB(ChildId int identity(100,1),name varchar(100), LevelValueID int references TableA(LevelValueId))
    Insert into TableB(name,LevelValueID) Select 'Childname1',1
    /********************************SAMPLE TARGET***************************************************************/
    /********************************SAMPLE SOURCE***************************************************************/
    Use Sample
    create table TableA(LevelValueId int identity(1,1) primary key, name varchar(100))
    Insert into TableA(name) Select 'C1'
    Insert into TableA(name) Select 'C2'
    create Table TableB(ChildId int identity(100,1),name varchar(100), LevelValueID int references TableA(LevelValueId))
    Insert into TableB(name,LevelValueID) Select 'Kidname1',1
    /********************************SAMPLE SOURCE***************************************************************/
    USe MSDNSamples
    /********************************MIGRATION INTERMEDIATE TABLE***************************************************************/
    --Migration table
    Create table Mg_TableA(LevelValueId int, NewValueId int)
    /********************************MIGRATION INTERMEDIATE TABLE***************************************************************/
    /********************************ACTUAL MIGRATION FOR MASTER TABLE***************************************************************/
    MERGE INTO TableA
    USING sample.dbo.TableA AS tv
    ON 1 = 0
    WHEN NOT MATCHED THEN
    INSERT(name) Values(tv.name)
    Output tv.levelValueId ,inserted.LevelValueid INTO
    Mg_TableA;
    /********************************ACTUAL MIGRATION FOR MASTER TABLE***************************************************************/
    /********************************ACTUAL MIGRATION FOR CHILD TABLE***************************************************************/
    Insert into TableB (name,LevelValueID)
    Select A.name,B.NewValueId From sample.dbo.TableB A
    Inner join Mg_TableA B on A.LevelValueID = B.LevelValueId
    /********************************ACTUAL MIGRATION FOR CHILD TABLE***************************************************************/
    /********************************TEST THE VALUES***************************************************************/
    Select * From TableA
    Select * From Mg_TableA
    Select * From TableB
    /********************************TEST THE VALUES***************************************************************/
    Drop table TableB,Tablea,Mg_TableA
    Use Sample
    Drop Table TableB,Tablea

Maybe you are looking for