dbTalk Databases Forums  

Use MS SQL Server 2005 Developer version to open MDF file?

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Use MS SQL Server 2005 Developer version to open MDF file? in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tim
 
Posts: n/a

Default Use MS SQL Server 2005 Developer version to open MDF file? - 03-01-2006 , 12:28 PM






Hello,
We do not run SQL Server in our shop, but I'm starting to be tasked with
analyzing SQL Server databases from outside shops. I will need to
open .MDF files sent to me. Can I do this using SQL Server 2005
Developer version? Or do we have to spring for the Workgroup version?
Thanks, in advance, for your help.
T

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Use MS SQL Server 2005 Developer version to open MDF file? - 03-01-2006 , 04:53 PM






Tim (tpl10 (AT) cornell (DOT) edu) writes:
Quote:
We do not run SQL Server in our shop, but I'm starting to be tasked with
analyzing SQL Server databases from outside shops. I will need to
open .MDF files sent to me. Can I do this using SQL Server 2005
Developer version? Or do we have to spring for the Workgroup version?
You don't really open an MDF file, but rather you attach it SQL Server,
which will open it, and then you can query it from a query tool.

You can use any edition of SQL Server 2005 for this.

However, you should also request to get the LDF file, the transaction
log, as it may be difficult to attach the MDF file alone.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #3  
Old   
DickChristoph
 
Posts: n/a

Default Re: Use MS SQL Server 2005 Developer version to open MDF file? - 03-01-2006 , 05:53 PM



Hi Tim

Why don't you ask them to run a backup of the database(s) in question to a
file and then restore the databases on your end. If the SQL Server 2005
developer version has a Enterprise Manager this is pretty easy to do. If not
read Books Online about the Restore Command.

BTW I don't know if you can attach an MDF that hasn't been previously
detached (using sp_detach_db). Your customers almost certainly won't want to
detach their open databases just to send them to you, whereas a full backup
can be run on a open database. I suspect just doing a Copy of an open MDF
may give you a file you can't use in any way.

See books online about sp_attach_db and sp_detach_db and my favorite
sp_attach_single_file_db (which attaches an MDF without needing the LDF).

For Example:

EXEC sp_attach_single_file_db @dbname = 'pubs',
@physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'

You might try this with the file(s) you have and see if if works.

--
-Dick Christoph
"Tim" <tpl10 (AT) cornell (DOT) edu> wrote

Quote:
Hello,
We do not run SQL Server in our shop, but I'm starting to be tasked with
analyzing SQL Server databases from outside shops. I will need to open
.MDF files sent to me. Can I do this using SQL Server 2005 Developer
version? Or do we have to spring for the Workgroup version?
Thanks, in advance, for your help.
T



Reply With Quote
  #4  
Old   
Tim
 
Posts: n/a

Default Re: Use MS SQL Server 2005 Developer version to open MDF file? - 03-08-2006 , 07:59 AM



Thanks for the assistance! It's been very helpful.
Tim

DickChristoph wrote:
Quote:
Hi Tim

Why don't you ask them to run a backup of the database(s) in question to a
file and then restore the databases on your end. If the SQL Server 2005
developer version has a Enterprise Manager this is pretty easy to do. If not
read Books Online about the Restore Command.

BTW I don't know if you can attach an MDF that hasn't been previously
detached (using sp_detach_db). Your customers almost certainly won't want to
detach their open databases just to send them to you, whereas a full backup
can be run on a open database. I suspect just doing a Copy of an open MDF
may give you a file you can't use in any way.

See books online about sp_attach_db and sp_detach_db and my favorite
sp_attach_single_file_db (which attaches an MDF without needing the LDF).

For Example:

EXEC sp_attach_single_file_db @dbname = 'pubs',
@physname = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf'

You might try this with the file(s) you have and see if if works.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.