Announcement

Collapse
No announcement yet.

Merging data in database in SQL Server 2012

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Merging data in database in SQL Server 2012

    Hello,

    I am using SQL Server 2012. I have 2 databases, DB1 and DB2. DB1 contains data for the month of January, February and March. DB2 contains data between February to June. I would like to move the data from DB1 to DB2 so that DB2 contains data from January to June. I have used SQL Server Import and Export Data Wizard and it wizard completed successfully. However I ran into an issue. When I query DB2, I can see duplicates records. Does anyone know how I can merge data without duplicates? Any help is greatly appreciated.

    Thanks

    Salim

  • #2
    I would not even bother moving the data, just create a union query which retrieves from db1 and db2

    As far as the duplicate records go, are you sure there wasn't something already in DB2 before the import, or did you run the import more than once?
    Tom Jones
    MCT, MCSE (2000:Security & 2003), MCSA:Security & Messaging, MCDBA, MCDST, MCITP(EA, EMA, SA, EDA, ES, CS), MCTS, MCP, Sec+
    PhD, MSc, FIAP, MIITT
    IT Trainer / Consultant
    Ossian Ltd
    Scotland

    ** Remember to give credit where credit is due and leave reputation points where appropriate **

    Comment


    • #3
      Thank you so much for replying. I will try the UINON query. There was already data in DB2 before the import.

      Comment

      Working...
      X