469,344 Members | 6,380 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

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

Tim
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
Mar 1 '06 #1
3 22680
Tim (tp***@cornell.edu) writes:
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, es****@sommarskog.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
Mar 1 '06 #2
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" <tp***@cornell.edu> wrote in message
news:du**********@ruby.cit.cornell.edu...
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

Mar 2 '06 #3
Tim
Thanks for the assistance! It's been very helpful.
Tim

DickChristoph wrote:
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.

Mar 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Steve Buster | last post: by
14 posts views Thread by Developer | last post: by
1 post views Thread by =?Utf-8?B?Rmxhbm1hbg==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.