Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008
    Location
    India
    Posts
    40

    Unanswered: Data migration from DB2 to Sql server 2005

    I m working on data migration project in which we have to migrate DB2 to Sql server 2005.I am new to sql server.


    I am using SSIS package for data migration. There will be one OLEDB source which migrates the DB2 data to OLE DB Destination.

    Can anybody help me on resolving the following issues.
    [*]There is one inventory table in which Inventory transaction date is in the format YYYYDDD say 2008298 (Its stored as decimal (7,0) in mainframe DB2 which is in the format YYYYDDD).It should be changed to the format YYYYMMDD while migration. So in sql server table, it should be in proper format as it is to be displayed in the front end.
    [*]I don’t want to migrate the entire records in db2 to Sequel. I need to reduce the count to say 100.How to do that?
    [*]How do we apply filters while doing migration? I need the records with transaction year starting from 2000.All the records before that should be ignored and it should migrate only records where the transaction year is greater than 2000.
    [*]In DB2 tables, all the columns are either Char or packed decimal (even dates are stored as decimal format).So If I convert the char to varchar in sequel, will there be any data loss or any risk involved in doing that?


  2. #2
    Join Date
    Nov 2004
    Posts
    1,427
    Provided Answers: 4
    [*]There is one inventory table in which Inventory transaction date is in the format YYYYDDD say 2008298 (Its stored as decimal (7,0) in mainframe DB2 which is in the format YYYYDDD).It should be changed to the format YYYYMMDD while migration. So in sql server table, it should be in proper format as it is to be displayed in the front end.
    Code:
    select dateadd(DayOfYear,
                   CAST(right(InventoryTransactionDate, 3) as INT),
                   left(InventoryTransactionDate, 4) + '-01-01')
    [*]I don’t want to migrate the entire records in db2 to Sequel. I need to reduce the count to say 100.How to do that?
    In SQL Server
    Code:
    SELECT TOP 100 ...
    In DB2
    Code:
    SELECT .... WHERE ... FETCH FIRST 100 ROWS ONLY
    [*]How do we apply filters while doing migration? I need the records with transaction year starting from 2000.All the records before that should be ignored and it should migrate only records where the transaction year is greater than 2000.
    Code:
    SELECT ... WHERE YEAR(transaction) >= 2000
    [*]In DB2 tables, all the columns are either Char or packed decimal (even dates are stored as decimal format).So If I convert the char to varchar in sequel, will there be any data loss or any risk involved in doing that?
    No, But you have all data at hand. You can run those test yourself.

    Have you thought about how you will transfer all that data from DB2 to MSSQL?
    With kind regards . . . . . SQL Server 2000/2005/2012
    Wim

    Grabel's Law: 2 is not equal to 3 -- not even for very large values of 2.
    Pat Phelan's Law: 2 very definitely CAN equal 3 -- in at least two programming languages

  3. #3
    Join Date
    Oct 2008
    Location
    India
    Posts
    40
    Thanks a lot Wim for ur response

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •