Showing posts with label mdf. Show all posts
Showing posts with label mdf. Show all posts

Wednesday, March 28, 2012

Import MDF SQL 2000 file into SQL 2005 Express

Is it possible?
I only have the MDF from my SQL 2000 DB, and I need to import it to SQL
Server 2005...
Best Regards
Fabio CavassiniYou might try CREATE DATABASE...FOR ATTACH_REBUILD_LOG. This should work if
the database was properly detached from the SQL 2000 instance. See the SQL
2005 Books Online for more information.
Hope this helps.
Dan Guzman
SQL Server MVP
"Fabio Cavassini" <cavassinif@.gmail.com> wrote in message
news:1138068510.765889.178750@.g44g2000cwa.googlegroups.com...
> Is it possible?
> I only have the MDF from my SQL 2000 DB, and I need to import it to SQL
> Server 2005...
> Best Regards
> Fabio Cavassini
>|||Thanks Dan
I tried to attach it with sp_attach_db and it works...it converts the
format to the new version.
After that I got the following error when I want to create a Diagram:
"Database diagram support objects cannot be installed because this
database does not have a valid owner. To continue, first use the Files
page of the Database Properties dialog box or the ALTER AUTHORIZATION
statement to set the database owner to a valid login, then add the
database diagram support objects."
that this code fix...
EXEC sp_dbcmptlevel 'yourDB', '90';
go
ALTER AUTHORIZATION ON DATABASE::yourDB TO "yourLogin"
go
use [yourDB]
go
EXECUTE AS USER = N'dbo' REVERT
go
Best Regards
Fabio Cavassini|||> I tried to attach it with sp_attach_db and it works...it converts the
> format to the new version.
Just like the SQL 2000 version, sp_attach_db is basically just a wrapper for
CREATE DATABASE...FOR ATTACH. I don't recommend it in SQL 2005 because it
will be discontinued in a future version so you might as well get used to it
(or use a GUI that does this for you). From the SQL Server 2005 Books
Online:
<Excerpt
href="ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/tsqlref9/html/59bc993e-7913-4091
-89cb-d2871cffda95.htm">
Important:
This feature will be removed in a future version of Microsoft SQL Server.
Avoid using this feature in new development work, and plan to modify
applications that currently use this feature. We recommend that you use
CREATE DATABASE database_name FOR ATTACH instead. For more information, see
CREATE DATABASE (Transact-SQL).
</Excerpt>
Hope this helps.
Dan Guzman
SQL Server MVP
"Fabio Cavassini" <cavassinif@.gmail.com> wrote in message
news:1138070344.185793.284520@.f14g2000cwb.googlegroups.com...
> Thanks Dan
> I tried to attach it with sp_attach_db and it works...it converts the
> format to the new version.
> After that I got the following error when I want to create a Diagram:
> "Database diagram support objects cannot be installed because this
> database does not have a valid owner. To continue, first use the Files
> page of the Database Properties dialog box or the ALTER AUTHORIZATION
> statement to set the database owner to a valid login, then add the
> database diagram support objects."
> that this code fix...
> EXEC sp_dbcmptlevel 'yourDB', '90';
> go
> ALTER AUTHORIZATION ON DATABASE::yourDB TO "yourLogin"
> go
> use [yourDB]
> go
> EXECUTE AS USER = N'dbo' REVERT
> go
> Best Regards
> Fabio Cavassini
>|||Thanks for the info Dan, I'll consider it.
Best Regards
Fabio Cavassinisql

Import mdf file to server

Hi.
I have my *.mdf and *.ldf file and need to import it to my new sqlserver 2000.
Can anybody tell me how to do it
BEST REGARDS
BadleifEasy, you only need to attach the database. You can use the sp_attach_db system prodedure or go with the enterprise manager: right click on

your_server_name/databases

and the select "Attach Database"

and it's finished.

import MDF and LDF backup from SQL2000 to SQL2005

hi,

i have six files ( 3 MDF and 3 LDF) from a backup of a MS SQL 2000 server.

I installed MS SQL 2005 and wanted to Restore these Dataset. but they cant be accessed. doesnt SQL 2005 support these files ?

How can i use these files to access them with SQL 2005 ?

Thx,

Hello -

The files you're talking about are the "raw" data files that SQL Server uses, not a backup. When you take a backup from within SQL Server, files are acutally packaged a little differently, into a .bak file. When you use the BACKUP DATABASE command in SQL Server, it will create these files for you, which inlcude all of the "raw" files. You can then use the RESTORE DATABASE command to restore them to another (or the same) SQL Server.

All is not lost, however. If you have the MDF and LDF files, you can "adopt" these files directly into a running SQL Server system. That is called "attaching" a database. You can read more about that here:

http://msdn2.microsoft.com/en-us/library/ms190794.aspx

Buck Woody
http://www.buckwoody.com

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--