Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 408
  • Last Modified:

Append /Update SQL with .mdf file

I have SQL Server with Old Database (till Specific Date), and i have updated (.mdf & .ldf) files from the same SQL Server after that date. i want to merge or update the old Server with the new DB. how can i do that pls??

note: the two DB is identical (not in entries but in design).
0
vangeliseg06
Asked:
vangeliseg06
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you have to attach the "old" .mdf with another name, and perform the necessary insert/update/delete statements based on the design.
0
 
vangeliseg06Author Commented:
i'm new in SQL, so please tell me how can i move all the data after attaching it with different name! while the two db have the same tables and everything! the different only in the date of entries, First one from 2000 to 2003 and the new fom 2004 till now.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you can insert from 1 database to another like this:

insert into new_db.dbo.tablename ( <field list> )
  select <field list> from old_db.dbo.tablename

similary you can update and delete cross databases...
0
 
vangeliseg06Author Commented:
Thanks so much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now