Monday, March 12, 2012

Import data from MDF/LDF (not attach)

I have a rather large database that was shipped as an MDF/LDF pair.
These files were 'attach'ed into our running MS SQL Server 2000
instance with no problems.
A few weeks later, I now have another set of MDF/LDF files, an
incremental set of data that needs to be fed into the original
database.
What's the best way to import this data? Is there a cool little
stored procedure or somesuch, or will I be attaching these as a
separate, temporary database, and doing a INSERT ... SELECT * for each
table?
Thanks!This is a multi-part message in MIME format.
--=_NextPart_000_069A_01C3AD22.EE05D9C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
You'll likely have to attach that separately and then run a bunch of INSERT
SELECT WHERE NOT EXISTS (...) statements - one for each table.
--
Tom
---
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Wendell" <ojailoop@.yahoo.com> wrote in message
news:e77bc23a.0311171248.6e9258bf@.posting.google.com...
I have a rather large database that was shipped as an MDF/LDF pair.
These files were 'attach'ed into our running MS SQL Server 2000
instance with no problems.
A few weeks later, I now have another set of MDF/LDF files, an
incremental set of data that needs to be fed into the original
database.
What's the best way to import this data? Is there a cool little
stored procedure or somesuch, or will I be attaching these as a
separate, temporary database, and doing a INSERT ... SELECT * for each
table?
Thanks!
--=_NextPart_000_069A_01C3AD22.EE05D9C0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

You'll likely have to attach that =separately and then run a bunch of INSERT SELECT WHERE NOT EXISTS (...) statements - =one for each table.
-- Tom
---T=homas A. Moreau, BSc, PhD, MCSE, MCDBASQL Server MVPColumnist, SQL =Server ProfessionalToronto, ON Canadahttp://www.pinnaclepublishing.com/sql">www.pinnaclepublishing.com=/sql
"Wendell" wrote in =message news:e77bc2=3a.0311171248.6e9258bf@.posting.google.com...I have a rather large database that was shipped as an MDF/LDF pair. =These files were 'attach'ed into our running MS SQL Server 2000instance =with no problems.A few weeks later, I now have another set of MDF/LDF =files, anincremental set of data that needs to be fed into the originaldatabase.What's the best way to import this =data? Is there a cool littlestored procedure or somesuch, or will I be =attaching these as aseparate, temporary database, and doing a INSERT ... =SELECT * for eachtable?Thanks!

--=_NextPart_000_069A_01C3AD22.EE05D9C0--

No comments:

Post a Comment