Solved

Append /Update SQL with .mdf file

Posted on 2006-11-02
4
393 Views
Last Modified: 2008-03-17
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
Comment
Question by:vangeliseg06
  • 2
  • 2
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 125 total points
ID: 17856255
you have to attach the "old" .mdf with another name, and perform the necessary insert/update/delete statements based on the design.
0
 

Author Comment

by:vangeliseg06
ID: 17856292
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17856307
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
 

Author Comment

by:vangeliseg06
ID: 17856451
Thanks so much
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question